diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 0e7439b..d503028 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - name: Install system dependencies run: | apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-venv pipx + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-venv pipx - name: Install Poetry run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e65cf2e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: https://github.com/pycqa/flake8 + rev: 7.3.0 + hooks: + - id: flake8 + args: ["--select=F"] + types: [python] + + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.11.0 + hooks: + - id: black + language_version: python3 + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + + - repo: https://github.com/PyCQA/bandit + rev: 1.9.2 + hooks: + - id: bandit + files: ^src/jinjaturtle/ diff --git a/tests/test_roundtrip.py b/tests/test_roundtrip.py index 5182e8c..850cc9a 100644 --- a/tests/test_roundtrip.py +++ b/tests/test_roundtrip.py @@ -234,11 +234,11 @@ class TestRoundtripTOML: toml_text = """ name = "test" ports = [8080, 8081, 8082] - + [[database]] host = "db1.example.com" port = 5432 - + [[database]] host = "db2.example.com" port = 5433 diff --git a/tests/test_yaml_template_consistency.py b/tests/test_yaml_template_consistency.py index 69184dd..22a3c69 100644 --- a/tests/test_yaml_template_consistency.py +++ b/tests/test_yaml_template_consistency.py @@ -141,7 +141,7 @@ class TestTemplateYamlConsistency: [[database]] host = "db1.example.com" port = 5432 - + [[database]] host = "db2.example.com" port = 5433 @@ -218,15 +218,15 @@ class TestTemplateYamlConsistency: name = "myapp" version = "1.0" ports = [8080, 8081, 8082] - + [database] host = "localhost" port = 5432 - + [[servers]] name = "web1" ip = "10.0.0.1" - + [[servers]] name = "web2" ip = "10.0.0.2" @@ -485,7 +485,7 @@ class TestRegressionBugs: [[database]] host = "db1" port = 5432 - + [[database]] host = "db2" port = 5433