Update pyproject.toml

This commit is contained in:
2024-12-21 23:30:12 +01:00
parent 4ada50a4dc
commit 50ef8b5a8e

View File

@ -3,44 +3,55 @@ name = "anewdawn"
version = "0.1.0" version = "0.1.0"
description = "My shit bot" description = "My shit bot"
readme = "README.md" readme = "README.md"
requires-python = ">=3.12" requires-python = ">=3.13"
dependencies = ["discord-py", "openai", "python-dotenv"] dependencies = ["discord-py", "openai", "python-dotenv"]
[tool.ruff] [dependency-groups]
# https://docs.astral.sh/ruff/ dev = ["ruff"]
line-length = 120
fix = true
unsafe-fixes = true
extend-exclude = [".venv"]
show-fixes = true
[tool.ruff.lint] [tool.ruff]
# https://docs.astral.sh/ruff/linter/ # https://docs.astral.sh/ruff/linter/
preview = true preview = true
select = ["ALL"]
ignore = [ # Enable all rules
lint.select = ["ALL"]
# Ignore some rules
lint.ignore = [
"CPY001", # Checks for the absence of copyright notices within Python files. "CPY001", # Checks for the absence of copyright notices within Python files.
"D100", # Checks for undocumented public module definitions. "D100", # Checks for undocumented public module definitions.
"FIX002", # Checks for "TODO" comments.
"D104", # Checks for undocumented public package definitions. "D104", # Checks for undocumented public package definitions.
"D106", # Checks for undocumented public class definitions, for nested classes.
"ERA001", # Checks for commented-out Python code.
"FIX002", # Checks for "TODO" comments.
# Conflicting lint rules when using Ruff's formatter
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191", "COM812", # Checks for the absence of trailing commas.
"E111", "COM819", # Checks for the presence of prohibited trailing commas.
"E114", "D206", # Checks for docstrings that are indented with tabs.
"E117", "D300", # Checks for docstrings that use '''triple single quotes''' instead of """triple double quotes""".
"D206", "E111", # Checks for indentation with a non-multiple of 4 spaces.
"D300", "E114", # Checks for indentation of comments with a non-multiple of 4 spaces.
"Q000", "E117", # Checks for over-indented code.
"Q001", "ISC001", # Checks for implicitly concatenated strings on a single line.
"Q002", "ISC002", # Checks for implicitly concatenated strings that span multiple lines.
"Q003", "Q000", # Checks for inline strings that use single quotes or double quotes, depending on the value of the lint.flake8-quotes.inline-quotes option.
"COM812", "Q001", # Checks for multiline strings that use single quotes or double quotes, depending on the value of the lint.flake8-quotes.multiline-quotes setting.
"COM819", "Q002", # Checks for docstrings that use single quotes or double quotes, depending on the value of the lint.flake8-quotes.docstring-quotes setting.
"ISC001", "Q003", # Checks for strings that include escaped quotes, and suggests changing the quote style to avoid the need to escape them.
"ISC002", "W191", # Checks for indentation that uses tabs.
] ]
pydocstyle.convention = "google"
isort.required-imports = ["from __future__ import annotations"] # Default is 88 characters
line-length = 120
# https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
lint.pydocstyle.convention = "google"
# Add "from __future__ import annotations" to all files
lint.isort.required-imports = ["from __future__ import annotations"]
pycodestyle.ignore-overlong-task-comments = true pycodestyle.ignore-overlong-task-comments = true
[tool.ruff.format] [tool.ruff.format]
@ -48,11 +59,11 @@ pycodestyle.ignore-overlong-task-comments = true
docstring-code-format = true docstring-code-format = true
docstring-code-line-length = 20 docstring-code-line-length = 20
[tool.uv.workspace]
members = ["anewdawn"]
[dependency-groups]
dev = ["ruff>=0.8.0"]
[tool.ruff.lint.per-file-ignores] [tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101", "ARG", "FBT"] "**/tests/**" = [
"ARG", # Unused function args -> fixtures nevertheless are functionally relevant...
"FBT", # Don't care about booleans as positional arguments in tests, e.g. via @pytest.mark.parametrize()
"PLR2004", # Magic value used in comparison, ...
"S101", # asserts allowed in tests...
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
]