Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarchmer committed Jul 28, 2024
1 parent aadb443 commit 4af5fce
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
default_language_version:
python: python3.11

repos:
# - repo: https://github.com/jorisroovers/gitlint
# rev: v0.19.1
# hooks:
# - id: gitlint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: trailing-whitespace
- id: check-case-conflict
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-json
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: name-tests-test
exclude: '/(helpers\.py|base\.py)'
args: [--django]

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: forbid-crlf

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
args: [ "--config", "pyproject.toml" ]
135 changes: 134 additions & 1 deletion pdm.lock

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

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dev = [
"coverage>=7.6.0",
"mock>=5.1.0",
"requests-mock>=1.12.1",
"pre-commit>=3.7.1",
]
[build-system]
requires = ["pdm-backend"]
Expand Down Expand Up @@ -73,4 +74,4 @@ ignore = [
"ANN003", # **kwargs
"D203", "D212", # D203 and D211, D212 and D213 are mutually exclusive
]
namespace-packages = ["scripts", "scripts/docker"]
namespace-packages = ["scripts", "scripts/docker"]

0 comments on commit 4af5fce

Please sign in to comment.