Skip to content
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
8 changes: 6 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ charset = utf-8
[*.py]
max_line_length = 99

# Smaller indent for YAML
[*.{yaml,yml}]
# Smaller indent for TOML/YAML
[*.{toml,yaml,yml}]
indent_size = 2

# Use 2 spaces for the HTML files
[*.html]
indent_size = 2

# Makefiles always use tabs for indentation
Expand Down
32 changes: 17 additions & 15 deletions .github/matrix.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# noqa:INP001
import fileinput
import json
import re
Expand All @@ -9,21 +10,22 @@
def main():
actions_matrix = []

for tox_env in fileinput.input():
tox_env = tox_env.rstrip()

if python_match := PY_VERSIONS_RE.match(tox_env):
version_tuple = python_match.groups()
else:
version_tuple = sys.version_info[0:2]

python_version = "{}.{}".format(*version_tuple)
actions_matrix.append(
{
"python": python_version,
"tox_env": tox_env,
}
)
with fileinput.input() as f:
for tox_env_line in f:
tox_env = tox_env_line.rstrip()

if python_match := PY_VERSIONS_RE.match(tox_env):
version_tuple = python_match.groups()
else:
version_tuple = sys.version_info[0:2]

python_version = "{}.{}".format(*version_tuple)
actions_matrix.append(
{
"python": python_version,
"tox_env": tox_env,
}
)

print(json.dumps(actions_matrix)) # noqa:T201

Expand Down
2 changes: 1 addition & 1 deletion findreplace/management/commands/findreplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ def get_fields(self):
for model in app.get_models():
for field in model._meta.get_fields():
if isinstance(field, models.CharField | models.TextField):
fields.append(field)
fields.append(field) # noqa:PERF401

return fields
100 changes: 72 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ readme = 'README.md'
maintainers = [{ name = 'The Developer Society', email = 'studio@dev.ngo' }]
requires-python = '>= 3.10'
dependencies = [
'Django>=3.2',
'Django>=3.2',
]
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
]

[project.urls]
Homepage = "https://github.com/developersociety/django-findreplace"
Homepage = 'https://github.com/developersociety/django-findreplace'

[build-system]
requires = ['setuptools >= 61.0']
Expand All @@ -40,23 +40,67 @@ line-length = 99
target-version = 'py310'

[tool.ruff.lint]
select = [
'F', # pyflakes
'E', # pycodestyle
'W', # pycodestyle
'I', # isort
'N', # pep8-naming
'UP', # pyupgrade
'S', # flake8-bandit
'BLE', # flake8-blind-except
'C4', # flake8-comprehensions
'EM', # flake8-errmsg
'T20', # flake8-print
'RET', # flake8-return
'RUF', # ruff
extend-select = [
'ERA', # eradicate
'YTT', # flake8-2020
'ASYNC', # flake8-async
'S', # flake8-bandit
'BLE', # flake8-blind-except
'B', # flake8-bugbear
'A', # flake8-builtins
'COM', # flake8-commas
'C4', # flake8-comprehensions
'DTZ', # flake8-datetimez
'T10', # flake8-debugger
'DJ', # flake8-django
'EM', # flake8-errmsg
'EXE', # flake8-executable
'FA', # flake8-future-annotations
'INT', # flake8-gettext
'ISC', # flake8-implicit-str-concat
'ICN', # flake8-import-conventions
'LOG', # flake8-logging
'G', # flake8-logging-format
'INP', # flake8-no-pep420
'PIE', # flake8-pie
'T20', # flake8-print
'PYI', # flake8-pyi
'Q', # flake8-quotes
'RSE', # flake8-raise
'RET', # flake8-return
'SLOT', # flake8-slots
'SIM', # flake8-simplify
'TID', # flake8-tidy-imports
'TD', # flake8-todos
'TCH', # flake8-type-checking
'PTH', # flake8-use-pathlib
'FLY', # flynt
'I', # isort
'NPY', # numpy-specific rules
'PD', # pandas-vet
'N', # pep8-naming
'PERF', # perflint
'E', # pycodestyle
'W', # pycodestyle
'F', # pyflakes
'PGH', # pygrep-hooks
'PLC', # pylint
'PLE', # pylint
'PLW', # pylint
'UP', # pyupgrade
'FURB', # refurb
'RUF', # ruff-specific rules
'TRY', # tryceratops
]
ignore = [
'EM101', # flake8-errmsg: raw-string-in-exception
'COM812', # flake8-commas: missing-trailing-comma
'EM101', # flake8-errmsg: raw-string-in-exception
'ISC001', # flake8-implicit-str-concat: single-line-implicit-string-concatenation
'RUF012', # ruff-specific rules: mutable-class-default
'SIM105', # flake8-simplify: suppressible-exception
'SIM108', # flake8-simplify: if-else-block-instead-of-if-exp
'TD002', # flake8-todos: missing-todo-author
'TRY003', # tryceratops: raise-vanilla-args
]

[tool.ruff.lint.isort]
Expand Down
2 changes: 1 addition & 1 deletion requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ build==1.4.2
check-wheel-contents==0.6.3
coverage==7.13.5
pipdeptree==2.34.0
ruff==0.8.4
ruff==0.15.8
twine==6.2.0