mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 11:36:54 +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)
|
||||
|
||||
fix = None
|
||||
if args.fix == MixedLineEndingOption.NO.opt_name:
|
||||
fix = MixedLineEndingOption.NO
|
||||
elif args.fix == MixedLineEndingOption.CRLF.opt_name:
|
||||
fix = MixedLineEndingOption.CRLF
|
||||
elif args.fix == MixedLineEndingOption.LF.opt_name:
|
||||
fix = MixedLineEndingOption.LF
|
||||
else:
|
||||
fix = MixedLineEndingOption.AUTO
|
||||
fix, = (
|
||||
member for name, member
|
||||
in MixedLineEndingOption.__members__.items()
|
||||
if member.opt_name == args.fix
|
||||
)
|
||||
|
||||
args.verbose = min(args.verbose, 2)
|
||||
severity = VERBOSE_OPTION_TO_LOGGING_SEVERITY.get(args.verbose)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue