generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to more basic pre-commit from pyrenew
- Loading branch information
1 parent
f6a32a2
commit a91ef10
Showing
6 changed files
with
312 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ on: | |
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
|
@@ -13,10 +17,4 @@ jobs: | |
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Set up Quarto | ||
uses: quarto-dev/quarto-actions/setup@v2 | ||
- name: Install Poetry | ||
run: pip install poetry | ||
- name: Install packages | ||
run: poetry install --with dev | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,39 @@ | ||
repos: | ||
################################################################################ | ||
# GENERAL | ||
################################################################################ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
##### | ||
# Basic file cleanliness | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-added-large-files | ||
args: ["--maxkb=10000"] | ||
- id: check-yaml | ||
args: ["--allow-multiple-documents"] | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
# prevent giant files from being committed. | ||
- id: check-added-large-files | ||
args: ["--maxkb=10000"] | ||
# simply check whether files parse as valid | ||
# python | ||
- id: check-ast | ||
# check for files with names that would | ||
# conflict on a case-insensitive filesystem | ||
# like MacOS HFS+ or Windows FAT. | ||
- id: check-case-conflict | ||
# checks for a common error of placing | ||
# code before the docstring. | ||
- id: check-docstring-first | ||
# attempts to load all yaml files to | ||
# verify syntax. | ||
- id: check-yaml | ||
# allow yaml files which use the | ||
# multi-document syntax | ||
args: ["--allow-multiple-documents"] | ||
# attempts to load all TOML files to | ||
# verify syntax. | ||
- id: check-toml | ||
# makes sure files end in a newline and | ||
# only a newline. | ||
- id: end-of-file-fixer | ||
# replaces or checks mixed line ending. | ||
- id: mixed-line-ending | ||
# verifies that test files are named | ||
# correctly. | ||
- id: name-tests-test | ||
# ensure tests match test_.*\.py | ||
args: ["--pytest-test-first"] | ||
# trims trailing whitespace. | ||
- id: trailing-whitespace | ||
# checks that non-binary executables have | ||
# a proper shebang. | ||
- id: check-executables-have-shebangs | ||
files: \.sh$ | ||
################################################################################ | ||
# QUARTO README RENDERING | ||
################################################################################ | ||
- repo: local | ||
hooks: | ||
- id: render-quarto-readme | ||
name: "render README.qmd as README.md" | ||
entry: "./scripts/hooks/render-quarto-readme.sh" | ||
language: script | ||
always_run: true | ||
files: "README.(q|)md" | ||
################################################################################ | ||
# PYTHON | ||
################################################################################ | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black", "--line-length", "79"] | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.3 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
##### | ||
# Python | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.7.1 | ||
hooks: | ||
# Sort imports | ||
- id: ruff | ||
args: ["--ignore=E741", "--ignore=E731", "--fix"] | ||
################################################################################ | ||
# GITHUB ACTIONS | ||
################################################################################ | ||
- repo: https://github.com/rhysd/actionlint | ||
rev: v1.7.4 | ||
hooks: | ||
- id: actionlint | ||
################################################################################ | ||
# SPELLING | ||
################################################################################ | ||
- repo: https://github.com/crate-ci/typos | ||
rev: typos-dict-v0.11.37 | ||
hooks: | ||
- id: typos | ||
args: ["--force-exclude"] | ||
################################################################################ | ||
# COMMIT MESSAGES | ||
################################################################################ | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v4.1.0 | ||
hooks: | ||
- id: commitizen | ||
- repo: https://github.com/jorisroovers/gitlint | ||
rev: v0.19.1 | ||
hooks: | ||
- id: gitlint | ||
################################################################################ | ||
args: ["check", "--select", "I", "--fix"] | ||
# Run the linter | ||
- id: ruff | ||
# Run the formatter | ||
- id: ruff-format | ||
args: ["--line-length", "79"] | ||
##### | ||
# R | ||
- repo: https://github.com/lorenzwalthert/precommit | ||
rev: v0.4.3 | ||
hooks: | ||
- id: style-files | ||
- id: lintr | ||
# Secrets | ||
- repo: https://github.com/Yelp/detect-secrets | ||
rev: v1.5.0 | ||
hooks: | ||
- id: detect-secrets | ||
args: ["--baseline", ".secrets.baseline"] | ||
exclude: package.lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
repos: | ||
################################################################################ | ||
# GENERAL | ||
################################################################################ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-added-large-files | ||
args: ["--maxkb=10000"] | ||
- id: check-yaml | ||
args: ["--allow-multiple-documents"] | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
# prevent giant files from being committed. | ||
- id: check-added-large-files | ||
args: ["--maxkb=10000"] | ||
# simply check whether files parse as valid | ||
# python | ||
- id: check-ast | ||
# check for files with names that would | ||
# conflict on a case-insensitive filesystem | ||
# like MacOS HFS+ or Windows FAT. | ||
- id: check-case-conflict | ||
# checks for a common error of placing | ||
# code before the docstring. | ||
- id: check-docstring-first | ||
# attempts to load all yaml files to | ||
# verify syntax. | ||
- id: check-yaml | ||
# allow yaml files which use the | ||
# multi-document syntax | ||
args: ["--allow-multiple-documents"] | ||
# attempts to load all TOML files to | ||
# verify syntax. | ||
- id: check-toml | ||
# makes sure files end in a newline and | ||
# only a newline. | ||
- id: end-of-file-fixer | ||
# replaces or checks mixed line ending. | ||
- id: mixed-line-ending | ||
# verifies that test files are named | ||
# correctly. | ||
- id: name-tests-test | ||
# ensure tests match test_.*\.py | ||
args: ["--pytest-test-first"] | ||
# trims trailing whitespace. | ||
- id: trailing-whitespace | ||
# checks that non-binary executables have | ||
# a proper shebang. | ||
- id: check-executables-have-shebangs | ||
files: \.sh$ | ||
################################################################################ | ||
# QUARTO README RENDERING | ||
################################################################################ | ||
- repo: local | ||
hooks: | ||
- id: render-quarto-readme | ||
name: "render README.qmd as README.md" | ||
entry: "./scripts/hooks/render-quarto-readme.sh" | ||
language: script | ||
always_run: true | ||
files: "README.(q|)md" | ||
################################################################################ | ||
# PYTHON | ||
################################################################################ | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black", "--line-length", "79"] | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.3 | ||
hooks: | ||
- id: ruff | ||
args: ["--ignore=E741", "--ignore=E731", "--fix"] | ||
################################################################################ | ||
# GITHUB ACTIONS | ||
################################################################################ | ||
- repo: https://github.com/rhysd/actionlint | ||
rev: v1.7.4 | ||
hooks: | ||
- id: actionlint | ||
################################################################################ | ||
# SPELLING | ||
################################################################################ | ||
- repo: https://github.com/crate-ci/typos | ||
rev: typos-dict-v0.11.37 | ||
hooks: | ||
- id: typos | ||
args: ["--force-exclude"] | ||
################################################################################ | ||
# COMMIT MESSAGES | ||
################################################################################ | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v4.1.0 | ||
hooks: | ||
- id: commitizen | ||
- repo: https://github.com/jorisroovers/gitlint | ||
rev: v0.19.1 | ||
hooks: | ||
- id: gitlint | ||
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
"version": "1.4.0", | ||
"plugins_used": [ | ||
{ | ||
"name": "ArtifactoryDetector" | ||
}, | ||
{ | ||
"name": "AWSKeyDetector" | ||
}, | ||
{ | ||
"name": "AzureStorageKeyDetector" | ||
}, | ||
{ | ||
"name": "Base64HighEntropyString", | ||
"limit": 4.5 | ||
}, | ||
{ | ||
"name": "BasicAuthDetector" | ||
}, | ||
{ | ||
"name": "CloudantDetector" | ||
}, | ||
{ | ||
"name": "DiscordBotTokenDetector" | ||
}, | ||
{ | ||
"name": "GitHubTokenDetector" | ||
}, | ||
{ | ||
"name": "HexHighEntropyString", | ||
"limit": 3.0 | ||
}, | ||
{ | ||
"name": "IbmCloudIamDetector" | ||
}, | ||
{ | ||
"name": "IbmCosHmacDetector" | ||
}, | ||
{ | ||
"name": "JwtTokenDetector" | ||
}, | ||
{ | ||
"name": "KeywordDetector", | ||
"keyword_exclude": "" | ||
}, | ||
{ | ||
"name": "MailchimpDetector" | ||
}, | ||
{ | ||
"name": "NpmDetector" | ||
}, | ||
{ | ||
"name": "PrivateKeyDetector" | ||
}, | ||
{ | ||
"name": "SendGridDetector" | ||
}, | ||
{ | ||
"name": "SlackDetector" | ||
}, | ||
{ | ||
"name": "SoftlayerDetector" | ||
}, | ||
{ | ||
"name": "SquareOAuthDetector" | ||
}, | ||
{ | ||
"name": "StripeDetector" | ||
}, | ||
{ | ||
"name": "TwilioKeyDetector" | ||
} | ||
], | ||
"filters_used": [ | ||
{ | ||
"path": "detect_secrets.filters.allowlist.is_line_allowlisted" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies", | ||
"min_level": 2 | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_indirect_reference" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_likely_id_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_lock_file" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_potential_uuid" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_sequential_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_swagger_file" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_templated_secret" | ||
} | ||
], | ||
"results": {}, | ||
"generated_at": "2023-09-24T19:52:08Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.