Merging upstream version 5.0.0+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
894e74df77
commit
e531b1b230
12 changed files with 153 additions and 26 deletions
|
@ -35,7 +35,7 @@ class GitLsFile(NamedTuple):
|
|||
filename: str
|
||||
|
||||
|
||||
def git_ls_files(paths: Sequence[str]) -> Generator[GitLsFile, None, None]:
|
||||
def git_ls_files(paths: Sequence[str]) -> Generator[GitLsFile]:
|
||||
outs = cmd_output('git', 'ls-files', '-z', '--stage', '--', *paths)
|
||||
for out in zsplit(outs):
|
||||
metadata, filename = out.split('\t')
|
||||
|
|
|
@ -11,7 +11,7 @@ import ruamel.yaml
|
|||
yaml = ruamel.yaml.YAML(typ='safe')
|
||||
|
||||
|
||||
def _exhaust(gen: Generator[str, None, None]) -> None:
|
||||
def _exhaust(gen: Generator[str]) -> None:
|
||||
for _ in gen:
|
||||
pass
|
||||
|
||||
|
|
|
@ -115,16 +115,20 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|||
f'Input File {json_file} is not a valid JSON, consider using '
|
||||
f'check-json',
|
||||
)
|
||||
return 1
|
||||
|
||||
if contents != pretty_contents:
|
||||
if args.autofix:
|
||||
_autofix(json_file, pretty_contents)
|
||||
else:
|
||||
diff_output = get_diff(contents, pretty_contents, json_file)
|
||||
sys.stdout.buffer.write(diff_output.encode())
|
||||
|
||||
status = 1
|
||||
else:
|
||||
if contents != pretty_contents:
|
||||
if args.autofix:
|
||||
_autofix(json_file, pretty_contents)
|
||||
else:
|
||||
diff_output = get_diff(
|
||||
contents,
|
||||
pretty_contents,
|
||||
json_file,
|
||||
)
|
||||
sys.stdout.buffer.write(diff_output.encode())
|
||||
|
||||
status = 1
|
||||
|
||||
return status
|
||||
|
||||
|
|
|
@ -115,7 +115,10 @@ def fix_requirements(f: IO[bytes]) -> int:
|
|||
# which is automatically added by broken pip package under Debian
|
||||
requirements = [
|
||||
req for req in requirements
|
||||
if req.value != b'pkg-resources==0.0.0\n'
|
||||
if req.value not in [
|
||||
b'pkg-resources==0.0.0\n',
|
||||
b'pkg_resources==0.0.0\n',
|
||||
]
|
||||
]
|
||||
|
||||
# sort the requirements and remove duplicates
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue