From 846d3cc2d641a2560a4a1bd47fe2a256e2304678 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:39:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pre_commit_hooks/check_json.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pre_commit_hooks/check_json.py b/pre_commit_hooks/check_json.py index 51e0f21c..ef4629a2 100644 --- a/pre_commit_hooks/check_json.py +++ b/pre_commit_hooks/check_json.py @@ -3,7 +3,8 @@ import argparse import json import re -from typing import Any, Sequence +from typing import Any +from typing import Sequence def raise_duplicate_keys( @@ -17,6 +18,7 @@ def raise_duplicate_keys( d[key] = val return d + def check_mixed_indentation(content: str, filename: str) -> bool: """ Checks a string content for mixed indentation (tabs and spaces) in leading whitespace. @@ -41,6 +43,7 @@ def check_mixed_indentation(content: str, filename: str) -> bool: return not found_mixed + def main(argv: Sequence[str] | None = None) -> int: parser = argparse.ArgumentParser() parser.add_argument('filenames', nargs='*', help='Filenames to check.') @@ -48,7 +51,7 @@ def main(argv: Sequence[str] | None = None) -> int: retval = 0 for filename in args.filenames: - with open(filename, 'r') as f: + with open(filename) as f: content = f.read() # Check for mixed indentation first