mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 18:16:52 +00:00
Fixups
This commit is contained in:
parent
4c3cc8f3ed
commit
b95dcad616
2 changed files with 5 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
sha: v0.7.0
|
||||
sha: 4c3cc8f3edc3c673b3a4abe2054e64f21d26772c
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ def _get_pretty_format(contents, indent, ensure_ascii=True, sort_keys=True, top_
|
|||
object_pairs_hook=pairs_first,
|
||||
),
|
||||
indent=indent,
|
||||
ensure_ascii=ensure_ascii
|
||||
)) + "\n" # dumps don't end with a newline
|
||||
ensure_ascii=ensure_ascii,
|
||||
)) + "\n" # dumps does not end with a newline
|
||||
|
||||
|
||||
def _autofix(filename, new_contents, encoding=None):
|
||||
|
|
@ -106,7 +106,7 @@ def pretty_format_json(argv=None):
|
|||
try:
|
||||
pretty_contents = _get_pretty_format(
|
||||
contents, args.indent, ensure_ascii=not args.no_ensure_ascii,
|
||||
sort_keys=not args.no_sort_keys, top_keys=args.top_keys
|
||||
sort_keys=not args.no_sort_keys, top_keys=args.top_keys,
|
||||
)
|
||||
|
||||
if contents != pretty_contents:
|
||||
|
|
@ -115,7 +115,7 @@ def pretty_format_json(argv=None):
|
|||
if args.autofix:
|
||||
_autofix(
|
||||
json_file, pretty_contents,
|
||||
encoding='utf-8' if args.no_ensure_ascii else None
|
||||
encoding='utf-8' if args.no_ensure_ascii else None,
|
||||
)
|
||||
|
||||
status = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue