Skip to content

Commit

Permalink
Replace black and flake8 by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed Oct 7, 2023
1 parent cde0f49 commit 99f1e53
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 17 deletions.
63 changes: 54 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,58 @@
[tool.black]
target-version = ['py310']
[tool.ruff]
line-length = 120
skip-string-normalization = true
extend-exclude = '''
(
/migrations/
| /templates/
)
'''
target-version = 'py310'
select = ['ALL'] # https://docs.astral.sh/ruff/rules/
extend-exclude = [
'*/migrations/*',
'*/templates/*',
'scripts/*',
'doc/conf.py',
]
ignore = [
'ANN', # Requires type annotation
'ARG002', # Unused function arguments
'B904', # Exception causes
'D', # Docstrings
'DTZ', # Timezone aware datetimes
'EM', # String literals in exceptions
'FIX', # Using FIXME/TODO/XXX comments
'ICN001', # Common package import alias
'PT', # Requires pytest
'RET', # Logic around return
'RUF012', # Requires type annotation
'SIM108', # Requires ternary operator instead of if-else
'SLF001', # Using 'private' members, e.g. _v_name
'TD001', # Allow FIXME
'TD002', # Requires TODO author
'TD003', # Requires TODO issue link
'TID252', # Requires absolute imports
'TRY003', # Long messages for common exception classes
'TRY200', # Requires cause for raise in except
]

[tool.ruff.isort]
lines-between-types = 1
section-order = [
'future',
'standard-library',
'third-party',
'django',
'sapphire',
'first-party',
'tests',
'local-folder',
]

[tool.ruff.isort.sections]
django = ['django']
sapphire = ['sapphire']
tests = ['tests']

[tool.ruff.flake8-quotes]
inline-quotes = 'single'

[tool.ruff.format]
quote-style = 'single'

[tool.coverage.run]
branch = true
Expand Down
10 changes: 2 additions & 8 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
black==22.8.0
# lint & format
ruff==0.0.292

# unittests
coverage
Faker
factory_boy

# flake8 tests
flake8
flake8-assertive
flake8-bugbear
flake8-isort
pep8-naming

# Docs
sphinx

Expand Down

0 comments on commit 99f1e53

Please sign in to comment.