Skip to content

check format using ruff #1457

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 7 commits into from
Aug 15, 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
20 changes: 20 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint

on: [push, pull_request]

jobs:
ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Ruff
run: |
python -m pip install ruff>=0.5
- name: Format check (Ruff)
run: |
ruff format --check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pip-log.txt
.coverage
.tox
.pytest_cache/
.ruff_cache/
nosetests.xml

# Translations
Expand Down
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
repos:
- repo: https://github.com/psf/black
rev: 24.8.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
hooks:
- id: black
exclude: ^(oauth2_provider/migrations/|tests/migrations/)
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand Down
15 changes: 4 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
[tool.black]
line-length = 110
target-version = ['py38']
exclude = '''
^/(
oauth2_provider/migrations/
| tests/migrations/
| .tox
)
'''

# Ref: https://github.com/codespell-project/codespell#using-a-config-file
[tool.codespell]
skip = '.git,package-lock.json,locale,AUTHORS,tox.ini'
check-hidden = true
ignore-regex = '.*pragma: codespell-ignore.*'
ignore-words-list = 'assertIn'

[tool.ruff]
line-length = 110
exclude = [".tox", "oauth2_provider/migrations/", "tests/migrations/", "manage.py"]
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ deps =
flake8
flake8-isort
flake8-quotes
flake8-black

[testenv:migrations]
setenv =
Expand Down
Loading