Merging upstream version 1.5.13.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
95e73670dd
commit
63136a4c14
5 changed files with 29 additions and 6 deletions
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
github: asottile
|
||||||
|
open_collective: pre-commit
|
|
@ -1,6 +1,6 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v2.5.0
|
rev: v3.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
|
@ -14,16 +14,16 @@ repos:
|
||||||
- id: check-byte-order-marker
|
- id: check-byte-order-marker
|
||||||
- id: fix-encoding-pragma
|
- id: fix-encoding-pragma
|
||||||
- repo: https://gitlab.com/pycqa/flake8
|
- repo: https://gitlab.com/pycqa/flake8
|
||||||
rev: 3.8.0
|
rev: 3.8.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
exclude: ^identify/vendor/licenses\.py$
|
exclude: ^identify/vendor/licenses\.py$
|
||||||
- repo: https://github.com/pre-commit/mirrors-autopep8
|
- repo: https://github.com/pre-commit/mirrors-autopep8
|
||||||
rev: v1.5.2
|
rev: v1.5.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: autopep8
|
- id: autopep8
|
||||||
- repo: https://github.com/asottile/reorder_python_imports
|
- repo: https://github.com/asottile/reorder_python_imports
|
||||||
rev: v2.3.0
|
rev: v2.3.6
|
||||||
hooks:
|
hooks:
|
||||||
- id: reorder-python-imports
|
- id: reorder-python-imports
|
||||||
args: [
|
args: [
|
||||||
|
@ -31,6 +31,6 @@ repos:
|
||||||
'--add-import', 'from __future__ import unicode_literals',
|
'--add-import', 'from __future__ import unicode_literals',
|
||||||
]
|
]
|
||||||
- repo: https://github.com/asottile/add-trailing-comma
|
- repo: https://github.com/asottile/add-trailing-comma
|
||||||
rev: v2.0.1
|
rev: v2.0.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: add-trailing-comma
|
- id: add-trailing-comma
|
||||||
|
|
|
@ -92,10 +92,12 @@ EXTENSIONS = {
|
||||||
'kml': {'text', 'kml', 'xml'},
|
'kml': {'text', 'kml', 'xml'},
|
||||||
'kt': {'text', 'kotlin'},
|
'kt': {'text', 'kotlin'},
|
||||||
'lean': {'text', 'lean'},
|
'lean': {'text', 'lean'},
|
||||||
|
'lektorproject': {'text', 'ini', 'lektorproject'},
|
||||||
'less': {'text', 'less'},
|
'less': {'text', 'less'},
|
||||||
'lhs': {'text', 'literate-haskell'},
|
'lhs': {'text', 'literate-haskell'},
|
||||||
'libsonnet': {'text', 'jsonnet'},
|
'libsonnet': {'text', 'jsonnet'},
|
||||||
'lidr': {'text', 'idris'},
|
'lidr': {'text', 'idris'},
|
||||||
|
'lr': {'text', 'lektor'},
|
||||||
'lua': {'text', 'lua'},
|
'lua': {'text', 'lua'},
|
||||||
'm': {'text', 'c', 'objective-c'},
|
'm': {'text', 'c', 'objective-c'},
|
||||||
'manifest': {'text', 'manifest'},
|
'manifest': {'text', 'manifest'},
|
||||||
|
@ -109,6 +111,7 @@ EXTENSIONS = {
|
||||||
'mli': {'text', 'ocaml'},
|
'mli': {'text', 'ocaml'},
|
||||||
'mm': {'text', 'c++', 'objective-c++'},
|
'mm': {'text', 'c++', 'objective-c++'},
|
||||||
'modulemap': {'text', 'modulemap'},
|
'modulemap': {'text', 'modulemap'},
|
||||||
|
'myst': {'text', 'myst'},
|
||||||
'ngdoc': {'text', 'ngdoc'},
|
'ngdoc': {'text', 'ngdoc'},
|
||||||
'nim': {'text', 'nim'},
|
'nim': {'text', 'nim'},
|
||||||
'nims': {'text', 'nim'},
|
'nims': {'text', 'nim'},
|
||||||
|
@ -137,10 +140,12 @@ EXTENSIONS = {
|
||||||
'pxi': {'text', 'cython'},
|
'pxi': {'text', 'cython'},
|
||||||
'py': {'text', 'python'},
|
'py': {'text', 'python'},
|
||||||
'pyi': {'text', 'pyi'},
|
'pyi': {'text', 'pyi'},
|
||||||
|
'pyproj': {'text', 'xml', 'pyproj'},
|
||||||
'pyx': {'text', 'cython'},
|
'pyx': {'text', 'cython'},
|
||||||
'pyz': {'binary', 'pyz'},
|
'pyz': {'binary', 'pyz'},
|
||||||
'pyzw': {'binary', 'pyz'},
|
'pyzw': {'binary', 'pyz'},
|
||||||
'r': {'text', 'r'},
|
'r': {'text', 'r'},
|
||||||
|
'rake': {'text', 'ruby'},
|
||||||
'rb': {'text', 'ruby'},
|
'rb': {'text', 'ruby'},
|
||||||
'rs': {'text', 'rust'},
|
'rs': {'text', 'rust'},
|
||||||
'rst': {'text', 'rst'},
|
'rst': {'text', 'rst'},
|
||||||
|
@ -182,6 +187,8 @@ EXTENSIONS = {
|
||||||
'txsprofile': {'text', 'ini', 'txsprofile'},
|
'txsprofile': {'text', 'ini', 'txsprofile'},
|
||||||
'txt': {'text', 'plain-text'},
|
'txt': {'text', 'plain-text'},
|
||||||
'v': {'text', 'verilog'},
|
'v': {'text', 'verilog'},
|
||||||
|
'vbproj': {'text', 'xml', 'vbproj'},
|
||||||
|
'vcxproj': {'text', 'xml', 'vcxproj'},
|
||||||
'vdx': {'text', 'vdx'},
|
'vdx': {'text', 'vdx'},
|
||||||
'vh': {'text', 'verilog'},
|
'vh': {'text', 'verilog'},
|
||||||
'vhd': {'text', 'vhdl'},
|
'vhd': {'text', 'vhdl'},
|
||||||
|
@ -223,14 +230,18 @@ NAMES = {
|
||||||
'.bash_profile': EXTENSIONS['bash'],
|
'.bash_profile': EXTENSIONS['bash'],
|
||||||
'.bashrc': EXTENSIONS['bash'],
|
'.bashrc': EXTENSIONS['bash'],
|
||||||
'.bowerrc': EXTENSIONS['json'] | {'bowerrc'},
|
'.bowerrc': EXTENSIONS['json'] | {'bowerrc'},
|
||||||
|
'.browserslistrc': {'text', 'browserslistrc'},
|
||||||
|
'.codespellrc': EXTENSIONS['ini'] | {'codespellrc'},
|
||||||
'.coveragerc': EXTENSIONS['ini'] | {'coveragerc'},
|
'.coveragerc': EXTENSIONS['ini'] | {'coveragerc'},
|
||||||
'.cshrc': EXTENSIONS['csh'],
|
'.cshrc': EXTENSIONS['csh'],
|
||||||
|
'.csslintrc': EXTENSIONS['json'] | {'csslintrc'},
|
||||||
'.dockerignore': {'text', 'dockerignore'},
|
'.dockerignore': {'text', 'dockerignore'},
|
||||||
'.editorconfig': {'text', 'editorconfig'},
|
'.editorconfig': {'text', 'editorconfig'},
|
||||||
'.flake8': EXTENSIONS['ini'] | {'flake8'},
|
'.flake8': EXTENSIONS['ini'] | {'flake8'},
|
||||||
'.gitattributes': {'text', 'gitattributes'},
|
'.gitattributes': {'text', 'gitattributes'},
|
||||||
'.gitconfig': EXTENSIONS['ini'] | {'gitconfig'},
|
'.gitconfig': EXTENSIONS['ini'] | {'gitconfig'},
|
||||||
'.gitignore': {'text', 'gitignore'},
|
'.gitignore': {'text', 'gitignore'},
|
||||||
|
'.gitlint': EXTENSIONS['ini'] | {'gitlint'},
|
||||||
'.gitmodules': {'text', 'gitmodules'},
|
'.gitmodules': {'text', 'gitmodules'},
|
||||||
'.hgrc': EXTENSIONS['ini'] | {'hgrc'},
|
'.hgrc': EXTENSIONS['ini'] | {'hgrc'},
|
||||||
'.jshintrc': EXTENSIONS['json'] | {'jshintrc'},
|
'.jshintrc': EXTENSIONS['json'] | {'jshintrc'},
|
||||||
|
@ -246,6 +257,8 @@ NAMES = {
|
||||||
'BUILD': {'text', 'bazel'},
|
'BUILD': {'text', 'bazel'},
|
||||||
'BUILD.bazel': {'text', 'bazel'},
|
'BUILD.bazel': {'text', 'bazel'},
|
||||||
'CMakeLists.txt': EXTENSIONS['cmake'],
|
'CMakeLists.txt': EXTENSIONS['cmake'],
|
||||||
|
'CHANGELOG': EXTENSIONS['txt'],
|
||||||
|
'CONTRIBUTING': EXTENSIONS['txt'],
|
||||||
'COPYING': EXTENSIONS['txt'],
|
'COPYING': EXTENSIONS['txt'],
|
||||||
'Dockerfile': {'text', 'dockerfile'},
|
'Dockerfile': {'text', 'dockerfile'},
|
||||||
'Gemfile': EXTENSIONS['rb'],
|
'Gemfile': EXTENSIONS['rb'],
|
||||||
|
@ -253,11 +266,13 @@ NAMES = {
|
||||||
'LICENSE': EXTENSIONS['txt'],
|
'LICENSE': EXTENSIONS['txt'],
|
||||||
'MAINTAINERS': EXTENSIONS['txt'],
|
'MAINTAINERS': EXTENSIONS['txt'],
|
||||||
'Makefile': EXTENSIONS['mk'],
|
'Makefile': EXTENSIONS['mk'],
|
||||||
|
'NEWS': EXTENSIONS['txt'],
|
||||||
'NOTICE': EXTENSIONS['txt'],
|
'NOTICE': EXTENSIONS['txt'],
|
||||||
'PATENTS': EXTENSIONS['txt'],
|
'PATENTS': EXTENSIONS['txt'],
|
||||||
'Pipfile': EXTENSIONS['toml'],
|
'Pipfile': EXTENSIONS['toml'],
|
||||||
'Pipfile.lock': EXTENSIONS['json'],
|
'Pipfile.lock': EXTENSIONS['json'],
|
||||||
'PKGBUILD': {'text', 'bash', 'pkgbuild', 'alpm'},
|
'PKGBUILD': {'text', 'bash', 'pkgbuild', 'alpm'},
|
||||||
|
'pylintrc': EXTENSIONS['ini'] | {'pylintrc'},
|
||||||
'README': EXTENSIONS['txt'],
|
'README': EXTENSIONS['txt'],
|
||||||
'Rakefile': EXTENSIONS['rb'],
|
'Rakefile': EXTENSIONS['rb'],
|
||||||
'setup.cfg': EXTENSIONS['ini'],
|
'setup.cfg': EXTENSIONS['ini'],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = identify
|
name = identify
|
||||||
version = 1.5.9
|
version = 1.5.13
|
||||||
description = File identification library for Python
|
description = File identification library for Python
|
||||||
long_description = file: README.md
|
long_description = file: README.md
|
||||||
long_description_content_type = text/markdown
|
long_description_content_type = text/markdown
|
||||||
|
|
|
@ -13,6 +13,12 @@ def test_extensions_have_binary_or_text(extension):
|
||||||
assert len({'text', 'binary'} & tags) == 1, tags
|
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)
|
@pytest.mark.parametrize('extension', extensions.EXTENSIONS_NEED_BINARY_CHECK)
|
||||||
def test_need_binary_check_do_not_specify_text_binary(extension):
|
def test_need_binary_check_do_not_specify_text_binary(extension):
|
||||||
tags = extensions.EXTENSIONS_NEED_BINARY_CHECK[extension]
|
tags = extensions.EXTENSIONS_NEED_BINARY_CHECK[extension]
|
||||||
|
|
Loading…
Add table
Reference in a new issue