8000 ci: Added pre-commit including ruff linting & formatting by marksweb · Pull Request #7788 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

ci: Added pre-commit including ruff linting & formatting #7788

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

Merged
merged 8 commits into from
Jan 29, 2024
Merged
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ quote_type = single
[*.rst]
max_line_length = 80

[*.toml]
indent_size = 2

[*.yml]
indent_size = 2
24 changes: 9 additions & 15 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,17 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
ruff:
name: ruff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff
run: |
ruff cms
ruff menus
- uses: actions/checkout@v4

- run: python -Im pip install --user ruff

- name: Run ruff on cms
run: ruff --output-format=github cms

- name: Run ruff on menus
run: ruff --output-format=github menus
54 changes: 54 additions & 0 deletions .pre-commit-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
ci:
autofix_commit_msg: |
ci: auto fixes from pre-commit hooks

for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: 'ci: pre-commit autoupdate'
autoupdate_schedule: monthly

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args: ["--py39-plus"]

- repo: https://github.com/adamchainz/django-upgrade
rev: '1.4.0'
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]

- repo: https://github.com/asottile/yesqa
rev: v1.3.0
hooks:
- id: yesqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.0
hooks:
- id: rstcheck
additional_dependencies:
- sphinx==6.1.3
- tomli==2.0.1
Loading
0