From c12c136585289501366a709e6c42a44fc541baf8 Mon Sep 17 00:00:00 2001 From: Derek Fitchett <135860892+dfitchett@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:42:04 -0700 Subject: [PATCH] Consolidated pre-commit-config.yaml files into repo level pre-commit. (#3582) * Consolidated pre-commit-config.yaml files into repo level pre-commit. --- .pre-commit-config.yaml | 34 ++++++++-------- domain-bie-events/.pre-commit-config.yaml | 44 --------------------- domain-cc/.pre-commit-config.yaml | 47 ----------------------- domain-ee/.pre-commit-config.yaml | 44 --------------------- 4 files changed, 15 insertions(+), 154 deletions(-) delete mode 100644 domain-bie-events/.pre-commit-config.yaml delete mode 100644 domain-cc/.pre-commit-config.yaml delete mode 100644 domain-ee/.pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8e5941e2ee..aac2e35132 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,12 +13,12 @@ repos: - id: check-useless-excludes - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v5.0.0 hooks: # https://github.com/pre-commit/pre-commit-hooks#hooks-available - id: check-merge-conflict - id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable - exclude: ^scripts/.*\.src$ + exclude: ^(scripts/.*\.src)|(.*/entrypoint.sh)$ - id: check-yaml - id: destroyed-symlinks - id: detect-private-key @@ -28,27 +28,23 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - # https://flake8.pycqa.org/en/latest/user/using-hooks.html#usage-with-the-pre-commit-git-hooks-framework - - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + - repo: https://github.com/zricethezav/gitleaks + rev: v8.20.1 hooks: - - id: flake8 - args: [--max-line-length=255] + - id: gitleaks +# Python project specific hooks - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort + args: ["--profile", "black"] - - repo: https://github.com/zricethezav/gitleaks - rev: v8.15.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.6.9 hooks: - - id: gitleaks - -# - repo: local -# hooks: -# - id: commit-message -# name: commit-message -# entry: scripts/commit-message.sh -# language: script -# stages: [commit-msg] + # Run the linter. + - id: ruff + # Run the formatter. + - id: ruff-format diff --git a/domain-bie-events/.pre-commit-config.yaml b/domain-bie-events/.pre-commit-config.yaml deleted file mode 100644 index 8de229fe18..0000000000 --- a/domain-bie-events/.pre-commit-config.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# Run pre-commit against all files by executing: pre-commit run --all-files -# Auto-update the config to the latest repos' versions by executing: pre-commit autoupdate -# Rather than disabling particular hooks (https://pre-commit.com/#temporarily-disabling-hooks), add an `exclude` - -repos: - - repo: meta - hooks: - - id: check-useless-excludes - - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 - hooks: # https://github.com/pre-commit/pre-commit-hooks#hooks-available - - id: check-merge-conflict - - id: check-executables-have-shebangs - - id: check-shebang-scripts-are-executable - exclude: ^scripts/.*\.src$ - - id: check-yaml - - id: destroyed-symlinks - - id: detect-private-key - - id: end-of-file-fixer # https://stackoverflow.com/questions/2287967/why-is-it-recommended-to-have-empty-line-in-the-end-of-a-source-file - - id: fix-byte-order-marker - - id: mixed-line-ending - - id: requirements-txt-fixer - - id: trailing-whitespace - - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - args: [--profile, black] - - - repo: https://github.com/astral-sh/ruff-pre-commit - # Ruff version. - rev: v0.4.4 - hooks: - # Run the linter. - - id: ruff - # Run the formatter. - - id: ruff-format - - - repo: https://github.com/zricethezav/gitleaks - rev: v8.15.0 - hooks: - - id: gitleaks diff --git a/domain-cc/.pre-commit-config.yaml b/domain-cc/.pre-commit-config.yaml deleted file mode 100644 index 5472a6fa5a..0000000000 --- a/domain-cc/.pre-commit-config.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# Run pre-commit against all files by executing: pre-commit run --all-files -# Auto-update the config to the latest repos' versions by executing: pre-commit autoupdate -# Rather than disabling particular hooks (https://pre-commit.com/#temporarily-disabling-hooks), add an `exclude` - -repos: - - repo: meta - hooks: - - id: check-useless-excludes - - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 - hooks: # https://github.com/pre-commit/pre-commit-hooks#hooks-available - - id: check-merge-conflict - - id: check-executables-have-shebangs - - id: check-shebang-scripts-are-executable - exclude: ^scripts/.*\.src$ - - id: check-yaml - - id: destroyed-symlinks - - id: detect-private-key - - id: end-of-file-fixer # https://stackoverflow.com/questions/2287967/why-is-it-recommended-to-have-empty-line-in-the-end-of-a-source-file - - id: fix-byte-order-marker - - id: mixed-line-ending - - id: requirements-txt-fixer - - id: trailing-whitespace - - - repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black - args: [--check] - - # https://flake8.pycqa.org/en/latest/user/using-hooks.html#usage-with-the-pre-commit-git-hooks-framework - - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 - hooks: - - id: flake8 - args: [--max-line-length=255] - - - repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - - - repo: https://github.com/zricethezav/gitleaks - rev: v8.15.0 - hooks: - - id: gitleaks diff --git a/domain-ee/.pre-commit-config.yaml b/domain-ee/.pre-commit-config.yaml deleted file mode 100644 index 8de229fe18..0000000000 --- a/domain-ee/.pre-commit-config.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# Run pre-commit against all files by executing: pre-commit run --all-files -# Auto-update the config to the latest repos' versions by executing: pre-commit autoupdate -# Rather than disabling particular hooks (https://pre-commit.com/#temporarily-disabling-hooks), add an `exclude` - -repos: - - repo: meta - hooks: - - id: check-useless-excludes - - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 - hooks: # https://github.com/pre-commit/pre-commit-hooks#hooks-available - - id: check-merge-conflict - - id: check-executables-have-shebangs - - id: check-shebang-scripts-are-executable - exclude: ^scripts/.*\.src$ - - id: check-yaml - - id: destroyed-symlinks - - id: detect-private-key - - id: end-of-file-fixer # https://stackoverflow.com/questions/2287967/why-is-it-recommended-to-have-empty-line-in-the-end-of-a-source-file - - id: fix-byte-order-marker - - id: mixed-line-ending - - id: requirements-txt-fixer - - id: trailing-whitespace - - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - args: [--profile, black] - - - repo: https://github.com/astral-sh/ruff-pre-commit - # Ruff version. - rev: v0.4.4 - hooks: - # Run the linter. - - id: ruff - # Run the formatter. - - id: ruff-format - - - repo: https://github.com/zricethezav/gitleaks - rev: v8.15.0 - hooks: - - id: gitleaks