diff --git a/pyproject.toml b/pyproject.toml index 9f840f51..cdd628e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,18 +45,57 @@ dev_template = "{tag}.dev{timestamp:%Y%m%d}+git.{sha}" dirty_template = "{tag}.dev{timestamp:%Y%m%d}+git.{sha}.dirty" tag_filter = "v.*" -[tool.black] +[tool.ruff] line-length = 88 -required-version = "23.12.1" -preview = true # FIXME: This behavior is only in 24.* release: https://github.com/psf/black/pull/3992 -extend-exclude = "third_party/" +preview = true # for certain rules and black preview behavior +select = [ + "F", # Flake8 + "E", "W", # pycodestyle + "I", # isort + "UP", # pyupgrade + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "EXE", # flake8-executable + "G", # flake8-logging-format + "SIM", # flake8-simplify + "NPY", # NumPy + "PERF", # Perflint + "PGH004", # no bare noqa + "PIE794", + "PIE800", + "PIE804", + "PIE807", + "PIE810", + "PLC0131", # type bivariance + "PLC0132", # type param mismatch + "PLC0205", # string as __slots__ + "PLE", + "PLR0133", # constant comparison + "PLR0206", # property with params + "PLR1722", # use sys exit + "PLW0129", # assert on string literal + "PLW0406", # import self + "PLW0711", # binary op exception + "PLW1509", # preexec_fn not safe with threads + "PLW3301", # nested min max + "PT006", # flake8-pytest-style + "PT022", + "PT023", + "PT024", + "PT025", + "PT026", + "PYI", # flake8-pyi + "TRY200", + "TRY302", + "RUF008", # mutable dataclass default + "RUF015", # access first ele in constant time + "RUF016", # type error non-integer index + "RUF017", # avoid quadratic list summation +] +exclude = ["third_party"] -[tool.isort] -profile = "black" -line_length = 88 -atomic = true -skip_gitignore = true -skip = ["third_party/"] +[tool.ruff.format] +docstring-code-format = true [tool.cibuildwheel] skip = ["*-musllinux_*", "pp*"]