Skip to content
Open
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
46 changes: 32 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -13,21 +13,45 @@ repos:
- id: trailing-whitespace
exclude: \.md$
- id: no-commit-to-branch

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.12
rev: v0.14.6
hooks:
- id: ruff-check
args: [--fix]
files: \.py$
- id: ruff-format
files: \.py$

- repo: https://github.com/trufflesecurity/trufflehog
rev: v3.91.1
hooks:
- id: trufflehog
name: TruffleHog Secrets Scanner
entry: trufflehog
language: golang

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we setting this to golang?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since trufflehog is a package written in golang, we have to specify the language for the hook to run.

types_or: [python, yaml, json, text]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this specific config?

Copy link
Contributor Author

@ParagEkbote ParagEkbote Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In types_or we define the types of program files for scanning using trufflehog. Do you think we need to define additional file types?

args:
[
"filesystem",
"src",
"tests",
".github/workflows",
"--results=verified,unknown",
"--exclude-paths=.venv",
"--fail"
]
stages: ["pre-commit", "pre-push"]

- repo: local
hooks:
- id: ty
name: ty check
name: type checking using ty
entry: uvx ty check .
language: system
types: [python]
pass_filenames: false
files: \.py$

- repo: local
hooks:
Expand All @@ -39,19 +63,13 @@ repos:
grep -v "^D" |
cut -f2- |
while IFS= read -r file; do
if [ -f "$file" ] && ["$file" != ".pre-commit-config.yaml"] && grep -q "pruna_pro" "$file"; then
echo "Error: pruna_pro found in staged file $file"
exit 1
fi
if [ -f "$file" ] && [ "$file" != ".pre-commit-config.yaml" ] && grep -q "pruna_pro" "$file"; then
echo "Error: pruna_pro found in staged file $file"
exit 1
fi
done
'
language: system
stages: [pre-commit]
types: [python]
exclude: "^docs/"
- id: trufflehog
name: TruffleHog
description: Detect secrets in your data.
entry: bash -c 'git diff --cached --name-only | xargs -I {} trufflehog filesystem {} --fail --no-update'
language: system
stages: ["pre-commit", "pre-push"]
files: \.py$