diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 81488a83..04c24f0f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,28 +11,24 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace -- repo: https://github.com/psf/black - rev: 22.1.0 - hooks: - - id: black - exclude: "reference_files" - - repo: https://github.com/pycqa/isort rev: 5.10.1 hooks: - id: isort - args: ["--profile", "black", "--filter-files"] - exclude: "reference_files" + +- repo: https://github.com/psf/black + rev: 22.1.0 + hooks: + - id: black - repo: https://gitlab.com/pycqa/flake8 rev: 4.0.1 hooks: - id: flake8 - args: ["--count", "--ignore", "E501, E203, W503"] exclude: "reference_files" - repo: https://github.com/PyCQA/bandit rev: 1.7.2 hooks: - id: bandit - args: ["--skip", "B101,B404,B603"] + args: ["-c", "bandit.yaml"] diff --git a/bandit.yaml b/bandit.yaml new file mode 100644 index 00000000..39b13489 --- /dev/null +++ b/bandit.yaml @@ -0,0 +1,13 @@ +skips: [ B101, B404, B603 ] + +exclude_dirs: + - .eggs + - .git + - .pytest_cache + - .tox + - reference_files + - tests + - build + - dist + - docs + - __pycache__ diff --git a/pyproject.toml b/pyproject.toml index 0010eb0d..4bfae7d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,3 +7,21 @@ write_to = "src/asdf_standard/_version.py" [tool.black] line-length = 120 +force-exclude = ''' +^/( + ( + \.eggs + | \.git + | \.pytest_cache + | \.tox + | reference_files + | build + | dist + )/ +) +''' + +[tool.isort] +profile = "black" +filter_files = true +line_length = 120 diff --git a/tests/test_yaml_schema.py b/tests/test_yaml_schema.py index eb251a7a..66b565e8 100644 --- a/tests/test_yaml_schema.py +++ b/tests/test_yaml_schema.py @@ -1,10 +1,5 @@ import pytest -from common import ( - YAML_SCHEMA_PATH, - assert_yaml_header_and_footer, - list_schema_paths, - load_yaml, -) +from common import YAML_SCHEMA_PATH, assert_yaml_header_and_footer, list_schema_paths, load_yaml from jsonschema import ValidationError