-
Notifications
You must be signed in to change notification settings - Fork 69
Enable TruffleHog in pre-commit and exclude markdown/svg files #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a44b94d
5f2ab56
01c6982
7df7eb7
adae547
6d92ddf
15dedd9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,4 +161,4 @@ cython_debug/ | |
| # ignore llama repository in resources | ||
| /resources/llama.cpp/ | ||
|
|
||
| tests/openai | ||
| tests/openai | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,112 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: check-case-conflict | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: check-merge-conflict | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: check-symlinks | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: check-toml | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: check-yaml | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: end-of-file-fixer | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: mixed-line-ending | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: trailing-whitespace | ||
| exclude: \.md$ | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: no-commit-to-branch | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps we could only include certain files? ".py" etc. this would simplify it a bit. |
||
| rev: v0.11.12 | ||
| rev: v0.14.1 | ||
| hooks: | ||
| - id: ruff-check | ||
| args: [--fix] | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
| - id: ruff-format | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
|
|
||
| - repo: https://github.com/trufflesecurity/trufflehog | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you rebase on main, I've also redone this implementation and forced only checking for files that have been commited, so this should resolve a huge part of it too. Perhaps we can also raise a certain error if this fails and redirect users to the install page? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, trufflehog is a golang package, not a python package. I think that this approach should simplify the usage for contributors and maintainers and not worry about installation at all. I could reduce the scope of files being checked to further improve the hook. WDYT? |
||
| rev: v3.90.11 | ||
| hooks: | ||
| - id: trufflehog | ||
| name: TruffleHog Secrets Scanner | ||
| entry: trufflehog | ||
| language: golang | ||
| types_or: [python, yaml, json, text] | ||
| args: | ||
| [ | ||
| "filesystem", | ||
| "src", | ||
| "tests", | ||
| ".github/workflows", | ||
| "--results=verified,unknown", | ||
| "--exclude-paths=.venv", | ||
| "--fail" | ||
| ] | ||
| stages: ["pre-commit", "pre-push"] | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$| | ||
| (^|/)venv/| | ||
| (^|/)\.venv/| | ||
| .*\.pyc$ | ||
| ) | ||
|
|
||
| - repo: local | ||
| hooks: | ||
|
|
@@ -28,9 +116,12 @@ repos: | |
| language: system | ||
| types: [python] | ||
| pass_filenames: false | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$ | ||
| ) | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: check-pruna-pro | ||
| name: Check for pruna_pro | ||
| entry: > | ||
|
|
@@ -48,10 +139,9 @@ repos: | |
| 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"] | ||
| exclude: | | ||
| (?x)^( | ||
| .*\.md$| | ||
| .*\.svg$| | ||
| ^docs/ | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we exluding these tests? I think we should include them, could you double check if this wasn't a mistake?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not included this change. It has been there for quite some time, the pre-commit hook must have formatted something 😄 : https://github.com/PrunaAI/pruna/blame/main/.gitignore