From bc8ceb967a1828ca2822c595c2257978db312020 Mon Sep 17 00:00:00 2001 From: Katy Baulch <46493669+katybaulch@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:31:24 +0100 Subject: [PATCH] Feature/pdct 986 merge old precommit file into trunk config (#262) * Remove old pre-commit file & merge into trunk config * Ignore JSON under test search fixtures folder --- .pre-commit-config.yaml | 43 ----------------------------------------- .trunk/trunk.yaml | 19 ++++++++++++++++-- 2 files changed, 17 insertions(+), 45 deletions(-) delete mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 4817c85f..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,43 +0,0 @@ -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 - hooks: - - id: check-json - exclude: tests/data/.*\.json - - id: detect-aws-credentials - args: [ --allow-missing-credentials ] - - id: trailing-whitespace - - id: end-of-file-fixer - exclude: ^.*\.egg-info/ - - id: check-merge-conflict - - id: check-case-conflict - - id: check-toml - - id: check-yaml - - id: check-ast - - id: debug-statements - - id: check-docstring-first - - - repo: https://github.com/python-poetry/poetry - rev: '1.7.1' - hooks: - - id: poetry-check - args: ["-C", "."] - - repo: https://github.com/ambv/black - rev: 23.1.0 - hooks: - - id: black - language_version: python3 - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.246' - hooks: - - id: ruff - - repo: local - hooks: - - id: pyright - name: pyright (backend) - entry: pyright - language: node - types: [python] - additional_dependencies: ['pyright@1.1.294'] - -# TODO more checks? e.g. bandit, safety, snyk, ... diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 04370896..08a16ea7 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -31,6 +31,13 @@ lint: - name: lint run: bandit --exit-zero -c bandit.yaml --format json --output ${tmpfile} ${target} + ignore: + - linters: [ALL] + paths: + # Ignore test data JSON files + - tests/data/**/*.json + - tests/search_fixtures/**/*.json + enabled: - actionlint@1.6.27 - bandit@1.7.8 @@ -44,9 +51,17 @@ lint: - oxipng@9.0.0 - pre-commit-hooks@4.5.0: commands: - - end-of-file-fixer + - check-ast + - check-case-conflict + - check-docstring-first - check-json - - detect-aws-credentials + - check-merge-conflict + - check-toml + - check-yaml + - debug-statements + - detect-aws-credentials --allow-missing-credentials + - end-of-file-fixer + - trailing-whitespace - prettier@3.2.5 - pyright@1.1.357 - ruff@0.3.5