mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 21:04:17 +00:00
Refactor pre_commit_hooks/mixed_line_ending.py
This commit is contained in:
parent
4be276c1a6
commit
ef4a323728
1 changed files with 5 additions and 9 deletions
|
|
@ -100,15 +100,11 @@ def _parse_arguments(argv=None):
|
||||||
)
|
)
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
|
||||||
fix = None
|
fix, = (
|
||||||
if args.fix == MixedLineEndingOption.NO.opt_name:
|
member for name, member
|
||||||
fix = MixedLineEndingOption.NO
|
in MixedLineEndingOption.__members__.items()
|
||||||
elif args.fix == MixedLineEndingOption.CRLF.opt_name:
|
if member.opt_name == args.fix
|
||||||
fix = MixedLineEndingOption.CRLF
|
)
|
||||||
elif args.fix == MixedLineEndingOption.LF.opt_name:
|
|
||||||
fix = MixedLineEndingOption.LF
|
|
||||||
else:
|
|
||||||
fix = MixedLineEndingOption.AUTO
|
|
||||||
|
|
||||||
args.verbose = min(args.verbose, 2)
|
args.verbose = min(args.verbose, 2)
|
||||||
severity = VERBOSE_OPTION_TO_LOGGING_SEVERITY.get(args.verbose)
|
severity = VERBOSE_OPTION_TO_LOGGING_SEVERITY.get(args.verbose)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue