Skip to content

Commit

Permalink
chore: update deprecated Ruff config
Browse files Browse the repository at this point in the history
In 0.2.0, https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md#020, config
entries related to linting settings have been moved. This commit moves the
deprecated entries under the right header in `pyproject.toml`.
  • Loading branch information
xavier-radix committed Feb 9, 2024
1 parent 1b7feaf commit 4675044
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions {{ cookiecutter.__package_name_kebab_case }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ xfail_strict = true

[tool.ruff] # https://github.com/charliermarsh/ruff
fix = true
ignore-init-module-imports = true
line-length = 100
src = ["src", "tests"]
target-version = "py{{ cookiecutter.python_version.split('.')[:2]|join }}"

[tool.ruff.lint]
ignore-init-module-imports = true
{%- if cookiecutter.development_environment == "strict" %}
select = ["A", "ASYNC", "B", "BLE", "C4", "C90", "D", "DTZ", "E", "EM", "ERA", "F", "FBT", "FLY", "FURB", "G", "I", "ICN", "INP", "INT", "ISC", "LOG", "N", "NPY", "PERF", "PGH", "PIE", "PLC", "PLE", "PLR", "PLW", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "S", "SIM", "SLF", "SLOT", "T10", "T20", "TCH", "TID", "TRY", "UP", "W", "YTT"]
ignore = ["E501", "PGH001", "RET504", "S101"]
Expand All @@ -147,18 +151,16 @@ select = ["A", "ASYNC", "B", "C4", "C90", "D", "DTZ", "E", "F", "FLY", "FURB", "
ignore = ["E501", "PGH001", "PGH002", "PGH003", "RET504", "S101"]
unfixable = ["F401", "F841"]
{%- endif %}
src = ["src", "tests"]
target-version = "py{{ cookiecutter.python_version.split('.')[:2]|join }}"

[tool.ruff.flake8-tidy-imports]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
{%- if cookiecutter.development_environment == "strict" %}

[tool.ruff.pycodestyle]
[tool.ruff.lint.pycodestyle]
max-doc-length = 100
{%- endif %}

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "{{ cookiecutter.docstring_style|lower }}"

[tool.poe.tasks] # https://github.com/nat-n/poethepoet
Expand Down

0 comments on commit 4675044

Please sign in to comment.