mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-30 10:16:54 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
fb0f6fac81
commit
df46f71980
3 changed files with 142 additions and 140 deletions
|
|
@ -151,7 +151,7 @@ def fix_requirements(f: IO[bytes], fail_without_version: bool) -> int:
|
|||
if before_string == after_string:
|
||||
return PASS
|
||||
else:
|
||||
print("Sorting requirements")
|
||||
print('Sorting requirements')
|
||||
f.seek(0)
|
||||
f.write(after_string)
|
||||
f.truncate()
|
||||
|
|
@ -161,8 +161,10 @@ def fix_requirements(f: IO[bytes], fail_without_version: bool) -> int:
|
|||
def main(argv: Sequence[str] | None = None) -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('filenames', nargs='*', help='Filenames to fix')
|
||||
parser.add_argument("--fail-without-version", action="store_true",
|
||||
help="Fail if a requirement is missing a version")
|
||||
parser.add_argument(
|
||||
'--fail-without-version', action='store_true',
|
||||
help='Fail if a requirement is missing a version',
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
retv = PASS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue