Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:

- name: Run pre-commit
if: env.LINT == 'pre-commit'
# Local-only hooks: the branch guard, and the secret scan of staged changes
# (GitHub push protection covers pushes).
env:
SKIP: no-commit-to-branch,gitleaks
run: |
python -m pip install pre-commit
pre-commit run --all-files --show-diff-on-failure
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ jobs:
echo "::error::Could not parse version from pyproject.toml"
exit 1
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "norm_tag=$norm_tag" >> "$GITHUB_OUTPUT"
echo "pkg=$pkg" >> "$GITHUB_OUTPUT"
{
echo "tag=$tag"
echo "norm_tag=$norm_tag"
echo "pkg=$pkg"
} >> "$GITHUB_OUTPUT"
# Mark RC/alpha/beta/dev tags as prereleases.
if echo "$pkg" | grep -qiE '(a|b|c|rc|alpha|beta|dev)[0-9]*$'; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
Expand Down
10 changes: 10 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Secret scan settings shared by all plugin repos (gitleaks pre-commit hook).
[extend]
useDefault = true
# The generic rule flags settings key names and test IDs, not secrets, in these repos.
disabledRules = ["generic-api-key"]

[[allowlists]]
description = "Third-party bundles and documentation placeholders"
paths = ['''(^|/)(3rdPartySoftware|vendor)/''', '''\.min\.js$''']
regexes = ['''YOUR_[A-Z_]+''']
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ repos:
args: [--unsafe]
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: detect-private-key
# Changes go through feature branches and pull requests.
- id: no-commit-to-branch
args: [--branch, main, --branch, dev, --branch, master, --branch, testing]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.1
hooks:
- id: gitleaks
- repo: https://github.com/PyCQA/isort
rev: 9.0.2
hooks:
Expand Down Expand Up @@ -46,3 +57,16 @@ repos:
rev: v0.11.0.1-1
hooks:
- id: shellcheck
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.39.0
hooks:
- id: check-github-workflows
- id: check-dependabot
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.27
hooks:
- id: validate-pyproject