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

Improve pre-commit configuration hooks #1645

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
28 changes: 24 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,29 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.6.0"
rev: "v5.0.0"
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
exclude_types: [json, sql]
- id: file-contents-sorter
files: ^(requirements/\w*.txt)$
args: ["--ignore-case", "--unique"]
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: ["--remove"]
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: "v3.17.0"
Expand All @@ -28,11 +40,11 @@ repos:
- id: django-upgrade
args: [--target-version, "4.2"]
- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.3.3"
hooks:
- id: prettier
exclude_types: [html, json, scss]
Expand All @@ -49,3 +61,11 @@ repos:
hooks:
- id: djhtml
files: .*/templates/.*\.html$
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.2.4"
hooks:
- id: pyproject-fmt
- repo: https://github.com/mrtazz/checkmake.git
rev: 0.2.2
hooks:
- id: checkmake
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SCSS = djangoproject/scss
JQUERY_FLOT=djangoproject/static/js/lib/jquery-flot
APP_LIST ?= accounts aggregator blog contact dashboard djangoproject docs foundation fundraising legacy members releases svntogit tracdb

.PHONY: collectstatics compile-scss compile-scss-debug watch-scss run install test ci
.PHONY: all ci clean collectstatics compile-scss compile-scss-debug install run test watch-scss

collectstatics: compile-scss
python -m manage collectstatic --noinput
Expand Down
1 change: 0 additions & 1 deletion fundraising/test_data/empty_payment.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"object": ""
},
"livemode": true,
"object": "event",
tobiasmcnulty marked this conversation as resolved.
Show resolved Hide resolved
"pending_webhooks": 1,
"request": null,
"type": "invoice.payment_succeeded"
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.black]
extend-exclude = "migrations"
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-r common.txt
pre-commit~=2.20.0
pre-commit~=3.5.0
watchdog==4.0.2