Skip to content
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

Add pre-commit and TruffleHog as mandatory requirements #18

Merged
merged 5 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
27 changes: 14 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
repos:
- repo: local
hooks:
# Run the formatter.
- id: ruff-format
name: ruff-format
description: "Run 'ruff format' for extremely fast Python formatting"
entry: ruff format
language: python
types_or: [python, pyi]
# Run the linter.
# Run the ruff linter and formatter using just command
- id: ruff
name: ruff
description: "Run 'ruff' for extremely fast Python linting"
entry: ruff check
args: [ --fix ] # Enable lint fixes.
language: python
types_or: [python, pyi]
description: "Format Python code using ruff format via just command"
entry: just format
language: system
types_or: [python, pyi]
pass_filenames: false

# Check for secrets
- id: trufflehog
name: TruffleHog
description: Detect secrets in your data.
lmazz1-dbt marked this conversation as resolved.
Show resolved Hide resolved
entry: bash -c 'trufflehog git file://. --since-commit HEAD --only-verified --fail'
language: system
stages: ["commit", "push"]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ With the truth threshold set to `1.0` by default, deterministic methodologies ar

This project is managed by [uv](https://docs.astral.sh/uv/), linted and formated with [ruff](https://docs.astral.sh/ruff/), and tested with [pytest](https://docs.pytest.org/en/stable/).

Secret scanning is done with [trufflehog](https://github.com/trufflesecurity/trufflehog).

For security, use of [pre-commit](https://pre-commit.com) is expected. Ensure your hooks are installed with `pre-commit install`.

Task running is done with [just](https://just.systems/man/en/). To see all available commands:

```console
Expand Down
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ format:
uv run ruff format .
uv run ruff check . --fix

# Scan for secrets
scan:
trufflehog git file://. --only-verified

# Run Python tests
test:
docker compose up -d --wait
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading