-
Notifications
You must be signed in to change notification settings - Fork 655
Run django-upgrade and linting on CI #2820
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
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Lint | ||
|
|
||
| on: [push, pull_request, workflow_dispatch] | ||
|
|
||
| permissions: {} | ||
|
|
||
| env: | ||
| FORCE_COLOR: 1 | ||
| RUFF_OUTPUT_FORMAT: github | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - uses: j178/prek-action@v1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| repos: | ||
| - repo: https://github.com/adamchainz/django-upgrade | ||
| rev: 1.29.1 | ||
| hooks: | ||
| - id: django-upgrade | ||
| args: [--target-version=4.2] | ||
|
|
||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-case-conflict | ||
| - id: check-merge-conflict | ||
| - id: check-json | ||
| - id: check-yaml | ||
| - id: debug-statements | ||
|
|
||
| - repo: https://github.com/python-jsonschema/check-jsonschema | ||
| rev: 0.34.0 | ||
| hooks: | ||
| - id: check-dependabot | ||
| - id: check-github-workflows | ||
|
|
||
| - repo: https://github.com/rhysd/actionlint | ||
| rev: v1.7.7 | ||
| hooks: | ||
| - id: actionlint | ||
|
|
||
| - repo: meta | ||
| hooks: | ||
| - id: check-hooks-apply | ||
| - id: check-useless-excludes | ||
|
|
||
| ci: | ||
| autoupdate_schedule: quarterly | ||
|
Comment on lines
+33
to
+34
Member
Author
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. In case we want to enable https://pre-commit.ci/ ? Be less spammy than the default weekly. 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. pre-commit.ci would also replace your github action and run faster. It's quite optimized
Member
Author
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. I think it's also useful to have it in GitHub Actions, to be able to already catch things in forks. |
||
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.
The tool looks for the Django version in
pyproject.toml. We don't have one, so defaults to 2.2. So let's specify it here, and remember to update when also bumping the Django version inbase-requirements.txt.https://django-upgrade.readthedocs.io/en/latest/options.html#cmdoption-target-version
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.
😬