diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-25 13:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-01-25 13:32:43 +0000 |
commit | 16854fb815633c4ca1334c21d04296060e8fda19 (patch) | |
tree | 0cb0f00ce35c81b55556778f34176b6eaa698222 | |
parent | Adding upstream version 1.5.9. (diff) | |
download | identify-16854fb815633c4ca1334c21d04296060e8fda19.tar.xz identify-16854fb815633c4ca1334c21d04296060e8fda19.zip |
Adding upstream version 1.5.13.upstream/1.5.13
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | .github/FUNDING.yml | 2 | ||||
-rw-r--r-- | .pre-commit-config.yaml | 10 | ||||
-rw-r--r-- | identify/extensions.py | 15 | ||||
-rw-r--r-- | setup.cfg | 2 | ||||
-rw-r--r-- | tests/extensions_test.py | 6 |
5 files changed, 29 insertions, 6 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..9408e44 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: asottile +open_collective: pre-commit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7187380..59813df 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.5.0 + rev: v3.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -14,16 +14,16 @@ repos: - id: check-byte-order-marker - id: fix-encoding-pragma - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.0 + rev: 3.8.4 hooks: - id: flake8 exclude: ^identify/vendor/licenses\.py$ - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.2 + rev: v1.5.4 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.3.0 + rev: v2.3.6 hooks: - id: reorder-python-imports args: [ @@ -31,6 +31,6 @@ repos: '--add-import', 'from __future__ import unicode_literals', ] - repo: https://github.com/asottile/add-trailing-comma - rev: v2.0.1 + rev: v2.0.2 hooks: - id: add-trailing-comma diff --git a/identify/extensions.py b/identify/extensions.py index 22b85c5..0098ec6 100644 --- a/identify/extensions.py +++ b/identify/extensions.py @@ -92,10 +92,12 @@ EXTENSIONS = { 'kml': {'text', 'kml', 'xml'}, 'kt': {'text', 'kotlin'}, 'lean': {'text', 'lean'}, + 'lektorproject': {'text', 'ini', 'lektorproject'}, 'less': {'text', 'less'}, 'lhs': {'text', 'literate-haskell'}, 'libsonnet': {'text', 'jsonnet'}, 'lidr': {'text', 'idris'}, + 'lr': {'text', 'lektor'}, 'lua': {'text', 'lua'}, 'm': {'text', 'c', 'objective-c'}, 'manifest': {'text', 'manifest'}, @@ -109,6 +111,7 @@ EXTENSIONS = { 'mli': {'text', 'ocaml'}, 'mm': {'text', 'c++', 'objective-c++'}, 'modulemap': {'text', 'modulemap'}, + 'myst': {'text', 'myst'}, 'ngdoc': {'text', 'ngdoc'}, 'nim': {'text', 'nim'}, 'nims': {'text', 'nim'}, @@ -137,10 +140,12 @@ EXTENSIONS = { 'pxi': {'text', 'cython'}, 'py': {'text', 'python'}, 'pyi': {'text', 'pyi'}, + 'pyproj': {'text', 'xml', 'pyproj'}, 'pyx': {'text', 'cython'}, 'pyz': {'binary', 'pyz'}, 'pyzw': {'binary', 'pyz'}, 'r': {'text', 'r'}, + 'rake': {'text', 'ruby'}, 'rb': {'text', 'ruby'}, 'rs': {'text', 'rust'}, 'rst': {'text', 'rst'}, @@ -182,6 +187,8 @@ EXTENSIONS = { 'txsprofile': {'text', 'ini', 'txsprofile'}, 'txt': {'text', 'plain-text'}, 'v': {'text', 'verilog'}, + 'vbproj': {'text', 'xml', 'vbproj'}, + 'vcxproj': {'text', 'xml', 'vcxproj'}, 'vdx': {'text', 'vdx'}, 'vh': {'text', 'verilog'}, 'vhd': {'text', 'vhdl'}, @@ -223,14 +230,18 @@ NAMES = { '.bash_profile': EXTENSIONS['bash'], '.bashrc': EXTENSIONS['bash'], '.bowerrc': EXTENSIONS['json'] | {'bowerrc'}, + '.browserslistrc': {'text', 'browserslistrc'}, + '.codespellrc': EXTENSIONS['ini'] | {'codespellrc'}, '.coveragerc': EXTENSIONS['ini'] | {'coveragerc'}, '.cshrc': EXTENSIONS['csh'], + '.csslintrc': EXTENSIONS['json'] | {'csslintrc'}, '.dockerignore': {'text', 'dockerignore'}, '.editorconfig': {'text', 'editorconfig'}, '.flake8': EXTENSIONS['ini'] | {'flake8'}, '.gitattributes': {'text', 'gitattributes'}, '.gitconfig': EXTENSIONS['ini'] | {'gitconfig'}, '.gitignore': {'text', 'gitignore'}, + '.gitlint': EXTENSIONS['ini'] | {'gitlint'}, '.gitmodules': {'text', 'gitmodules'}, '.hgrc': EXTENSIONS['ini'] | {'hgrc'}, '.jshintrc': EXTENSIONS['json'] | {'jshintrc'}, @@ -246,6 +257,8 @@ NAMES = { 'BUILD': {'text', 'bazel'}, 'BUILD.bazel': {'text', 'bazel'}, 'CMakeLists.txt': EXTENSIONS['cmake'], + 'CHANGELOG': EXTENSIONS['txt'], + 'CONTRIBUTING': EXTENSIONS['txt'], 'COPYING': EXTENSIONS['txt'], 'Dockerfile': {'text', 'dockerfile'}, 'Gemfile': EXTENSIONS['rb'], @@ -253,11 +266,13 @@ NAMES = { 'LICENSE': EXTENSIONS['txt'], 'MAINTAINERS': EXTENSIONS['txt'], 'Makefile': EXTENSIONS['mk'], + 'NEWS': EXTENSIONS['txt'], 'NOTICE': EXTENSIONS['txt'], 'PATENTS': EXTENSIONS['txt'], 'Pipfile': EXTENSIONS['toml'], 'Pipfile.lock': EXTENSIONS['json'], 'PKGBUILD': {'text', 'bash', 'pkgbuild', 'alpm'}, + 'pylintrc': EXTENSIONS['ini'] | {'pylintrc'}, 'README': EXTENSIONS['txt'], 'Rakefile': EXTENSIONS['rb'], 'setup.cfg': EXTENSIONS['ini'], @@ -1,6 +1,6 @@ [metadata] name = identify -version = 1.5.9 +version = 1.5.13 description = File identification library for Python long_description = file: README.md long_description_content_type = text/markdown diff --git a/tests/extensions_test.py b/tests/extensions_test.py index 44f16a8..4527a58 100644 --- a/tests/extensions_test.py +++ b/tests/extensions_test.py @@ -13,6 +13,12 @@ def test_extensions_have_binary_or_text(extension): assert len({'text', 'binary'} & tags) == 1, tags +@pytest.mark.parametrize('name', extensions.NAMES) +def test_names_have_binary_or_text(name): + tags = extensions.NAMES[name] + assert len({'text', 'binary'} & tags) == 1, tags + + @pytest.mark.parametrize('extension', extensions.EXTENSIONS_NEED_BINARY_CHECK) def test_need_binary_check_do_not_specify_text_binary(extension): tags = extensions.EXTENSIONS_NEED_BINARY_CHECK[extension] |