1
0
Fork 0

Merging upstream version 1.5.13.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-12 21:30:50 +01:00
parent 95e73670dd
commit 63136a4c14
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
5 changed files with 29 additions and 6 deletions

2
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,2 @@
github: asottile
open_collective: pre-commit

View file

@ -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

View file

@ -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'],

View file

@ -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

View file

@ -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]