Skip to content

Commit

Permalink
ci: Added ruff format rules (#7800)
Browse files Browse the repository at this point in the history
* chore: Added ruff format config

* chore: Set shorter docstring line length

* chore: Update ruff

* chore: Remove old config
  • Loading branch information
marksweb committed Feb 2, 2024
1 parent 4fbd4dc commit 9e56597
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repos:
- id: codespell

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.1.15
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ combine-as-imports = true
[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
docstring-code-line-length = 80
36 changes: 0 additions & 36 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,6 @@ bcrypt = bcrypt
[bdist_wheel]
universal=1

[flake8]
exclude =
.env,
.venv,
docs,
migrations,
node_modules,
cms/admin/__init__.py,
cms/models/__init__.py,
cms/sitemaps/__init__.py,
cms/test_utils/project/brokenpluginapp/cms_plugins.py,
cms/utils/__init__.py
cms/utils/compat/forms.py
ignore=
E701,
# multiple statements on one line
E722,
# do not use bare 'except'
E731,
# do not assign a lambda expression, use a def
W503,
# line break before binary operator
W605
# invalid escape sequence
max-line-length = 119

[isort]
line_length = 79
combine_as_imports = true
default_section = THIRDPARTY
include_trailing_comma = true
known_first_party = cms, menus
multi_line_output = 5
skip = migrations
skip_glob = cms/admin/__init__.py,cms/models/__init__.py

[codespell]
ignore-words-list = cant,statics,groupe,manuel,uptodate
skip = package-lock.json,*.js,*.js.html,*.po,./node_modules/*,./.idea/*,./docs/env/*,./docs/build/*,./.env/*,./.venv/*,./build/*,./django_cms.egg-info/*,./.git,./cms/test_utils/project/sampleapp/models.py,./venv/*,./docs/spelling_wordlist
Expand Down

0 comments on commit 9e56597

Please sign in to comment.