Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 2, 2024
1 parent 769c0bd commit 846d3cc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pre_commit_hooks/check_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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.
Expand All @@ -41,14 +43,15 @@ 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.')
args = parser.parse_args(argv)

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
Expand Down

0 comments on commit 846d3cc

Please sign in to comment.