Merging upstream version 2.3.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
9254dfcd61
commit
3d6a2404f9
5 changed files with 10 additions and 3 deletions
|
@ -35,7 +35,7 @@ repos:
|
||||||
- id: add-trailing-comma
|
- id: add-trailing-comma
|
||||||
args: [--py36-plus]
|
args: [--py36-plus]
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.25.0
|
rev: v2.28.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py36-plus]
|
args: [--py36-plus]
|
||||||
|
|
|
@ -62,6 +62,7 @@ EXTENSIONS = {
|
||||||
'gypi': {'text', 'gyp', 'python'},
|
'gypi': {'text', 'gyp', 'python'},
|
||||||
'gz': {'binary', 'gzip'},
|
'gz': {'binary', 'gzip'},
|
||||||
'h': {'text', 'header', 'c', 'c++'},
|
'h': {'text', 'header', 'c', 'c++'},
|
||||||
|
'hcl': {'text', 'hcl'},
|
||||||
'hh': {'text', 'header', 'c++'},
|
'hh': {'text', 'header', 'c++'},
|
||||||
'hpp': {'text', 'header', 'c++'},
|
'hpp': {'text', 'header', 'c++'},
|
||||||
'hs': {'text', 'haskell'},
|
'hs': {'text', 'haskell'},
|
||||||
|
|
|
@ -193,7 +193,11 @@ def parse_shebang(bytesio: IO[bytes]) -> Tuple[str, ...]:
|
||||||
|
|
||||||
cmd = tuple(_shebang_split(first_line.strip()))
|
cmd = tuple(_shebang_split(first_line.strip()))
|
||||||
if cmd and cmd[0] == '/usr/bin/env':
|
if cmd and cmd[0] == '/usr/bin/env':
|
||||||
cmd = cmd[1:]
|
if cmd[1] == '-S':
|
||||||
|
cmd = cmd[2:]
|
||||||
|
else:
|
||||||
|
cmd = cmd[1:]
|
||||||
|
|
||||||
if cmd == ('nix-shell',):
|
if cmd == ('nix-shell',):
|
||||||
return _parse_nix_shebang(bytesio, cmd)
|
return _parse_nix_shebang(bytesio, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = identify
|
name = identify
|
||||||
version = 2.2.14
|
version = 2.3.0
|
||||||
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
|
||||||
|
|
|
@ -314,6 +314,8 @@ def test_file_is_text_does_not_exist(tmpdir):
|
||||||
(b'\xf9\x93\x01\x42\xcd', ()),
|
(b'\xf9\x93\x01\x42\xcd', ()),
|
||||||
(b'#!\xf9\x93\x01\x42\xcd', ()),
|
(b'#!\xf9\x93\x01\x42\xcd', ()),
|
||||||
(b'#!\x00\x00\x00\x00', ()),
|
(b'#!\x00\x00\x00\x00', ()),
|
||||||
|
# shebang lines with multiple arguments
|
||||||
|
(b'#!/usr/bin/env -S python -u', ('python', '-u')),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
def test_parse_shebang(s, expected):
|
def test_parse_shebang(s, expected):
|
||||||
|
|
Loading…
Add table
Reference in a new issue