-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: Add various pre-commit hooks (#33)
- Loading branch information
Showing
5 changed files
with
194 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-added-large-files | ||
description: Prevents adding large files to the repository | ||
- id: check-merge-conflict | ||
description: Prevents adding files with merge conflict markers | ||
- id: check-toml | ||
description: Checks TOML files for syntax errors | ||
- id: name-tests-test | ||
description: Checks that test files are named correctly | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.2 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
types_or: [python, pyi] | ||
args: [--fix] | ||
# Run the formatter. | ||
- id: ruff-format | ||
types_or: [python, pyi] | ||
- repo: https://github.com/PyCQA/bandit | ||
rev: 1.8.0 | ||
hooks: | ||
- id: bandit | ||
description: Checks Python code for security issues | ||
- repo: https://github.com/Yelp/detect-secrets | ||
rev: v1.5.0 | ||
hooks: | ||
- id: detect-secrets | ||
args: ["--baseline", ".secrets.baseline"] | ||
# exclude: some_file.py |
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,153 @@ | ||
{ | ||
"version": "1.5.0", | ||
"plugins_used": [ | ||
{ | ||
"name": "ArtifactoryDetector" | ||
}, | ||
{ | ||
"name": "AWSKeyDetector" | ||
}, | ||
{ | ||
"name": "AzureStorageKeyDetector" | ||
}, | ||
{ | ||
"name": "Base64HighEntropyString", | ||
"limit": 4.5 | ||
}, | ||
{ | ||
"name": "BasicAuthDetector" | ||
}, | ||
{ | ||
"name": "CloudantDetector" | ||
}, | ||
{ | ||
"name": "DiscordBotTokenDetector" | ||
}, | ||
{ | ||
"name": "GitHubTokenDetector" | ||
}, | ||
{ | ||
"name": "GitLabTokenDetector" | ||
}, | ||
{ | ||
"name": "HexHighEntropyString", | ||
"limit": 3.0 | ||
}, | ||
{ | ||
"name": "IbmCloudIamDetector" | ||
}, | ||
{ | ||
"name": "IbmCosHmacDetector" | ||
}, | ||
{ | ||
"name": "IPPublicDetector" | ||
}, | ||
{ | ||
"name": "JwtTokenDetector" | ||
}, | ||
{ | ||
"name": "KeywordDetector", | ||
"keyword_exclude": "" | ||
}, | ||
{ | ||
"name": "MailchimpDetector" | ||
}, | ||
{ | ||
"name": "NpmDetector" | ||
}, | ||
{ | ||
"name": "OpenAIDetector" | ||
}, | ||
{ | ||
"name": "PrivateKeyDetector" | ||
}, | ||
{ | ||
"name": "PypiTokenDetector" | ||
}, | ||
{ | ||
"name": "SendGridDetector" | ||
}, | ||
{ | ||
"name": "SlackDetector" | ||
}, | ||
{ | ||
"name": "SoftlayerDetector" | ||
}, | ||
{ | ||
"name": "SquareOAuthDetector" | ||
}, | ||
{ | ||
"name": "StripeDetector" | ||
}, | ||
{ | ||
"name": "TelegramBotTokenDetector" | ||
}, | ||
{ | ||
"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": { | ||
".env.sample": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": ".env.sample", | ||
"hashed_secret": "57f319532cf4f5f2f506b9d546524ce8d1fed6e9", | ||
"is_verified": false, | ||
"line_number": 2 | ||
}, | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": ".env.sample", | ||
"hashed_secret": "b60d121b438a380c343d5ec3c2037564b82ffef3", | ||
"is_verified": false, | ||
"line_number": 5 | ||
} | ||
], | ||
"docker-compose.yml": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "docker-compose.yml", | ||
"hashed_secret": "57f319532cf4f5f2f506b9d546524ce8d1fed6e9", | ||
"is_verified": false, | ||
"line_number": 11 | ||
} | ||
] | ||
}, | ||
"generated_at": "2024-12-10T17:38:23Z" | ||
} |
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
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,4 @@ | ||
install: | ||
poetry install | ||
poetry run pre-commit install --allow-missing-config -f | ||
poetry run detect-secrets scan > .secrets.baseline |
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