Skip to content

Commit

Permalink
update pyproject for new ruff config and no-package setting
Browse files Browse the repository at this point in the history
  • Loading branch information
AbstractUmbra committed Dec 2, 2024
1 parent fc313aa commit b4fead3
Showing 1 changed file with 79 additions and 8 deletions.
87 changes: 79 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ authors = [
]
license = "MPL2.0"
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.11"
Expand All @@ -34,44 +35,114 @@ target-version = "py311"

[tool.ruff.lint]
select = [
"A",
"ANN",
"ASYNC",
"B",
"BLE",
"C4",
"COM",
"DTZ",
"E",
"EM",
"ERA",
"F",
"FA",
"FBT",
"FURB",
"G",
"I",
"INP",
"ISC",
"NPY",
"PD",
"PERF",
"PGH",
"PIE",
"PLC",
"PLE",
"PLW",
"PTH",
"PYI",
"Q",
"Q003",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"TCH",
"SLOT",
"T20",
"TC",
"TID",
"TRY",
"UP",
"W",
"PERF",
"ANN",
"YTT",
# "DOC", # not in a bot, please
]
ignore = [
"ANN401",
"ASYNC109", # dpy commonly uses this parameter
"EM101", # in this case this is okay
"F401",
"F402",
"F403",
"F405",
"INP001", # due to how I load modules this results in annoyances
"PD011", # this is not a numpy codebase
"PERF203",
"PLC0414", # pyright ruling for `as` imports needed
"Q000",
"RUF001",
"RUF009",
"S101", # assert is used for type checking in this codebase
"SIM105",
"TRY003", # over-eager rule
"TRY301", # unrealistic rule
"UP034",
"UP038",
"ANN101",
"ANN102",
"ANN401",
]
unfixable = [
"E501", # line length handled in other ways by ruff format
"ERA", # Don't delete commented out code
]

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.ruff.lint.isort]
split-on-trailing-comma = true
combine-as-imports = true

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
parametrize-names-type = "csv"

[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
inline-quotes = "double"

[tool.ruff.lint.flake8-tidy-imports.banned-api]
# https://discuss.python.org/t/problems-with-typeis/55410/6
# https://discuss.python.org/t/problems-with-typeis/55410/46
# Until what can go into a TypeIs/TypeGuard changes, these are just dangerous.
"typing.TypeIs".msg = "TypeIs is fundamentally unsafe, even when using it as described to be safe"
"typing.TypeGuard".msg = "TypeGuard is fundamentally unsafe"
"typing_extensions.TypeIs".msg = "TypeIs is fundamentally unsafe, even when using it as described to be safe"
"typing_extensions.TypeGuard".msg = "TypeGuard is fundamentally unsafe"

[tool.pyright]
useLibraryCodeForTypes = true
Expand Down

0 comments on commit b4fead3

Please sign in to comment.