|
| 1 | +[build-system] |
| 2 | +requires = [ |
| 3 | + "setuptools", |
| 4 | + "wheel", |
| 5 | +] |
| 6 | + |
| 7 | +[tool.ruff] |
| 8 | +line-length = 88 |
| 9 | + |
| 10 | +[tool.ruff.lint] |
| 11 | +select = [ |
| 12 | + # pycodestyle |
| 13 | + "E", |
| 14 | + "W", |
| 15 | + # Pyflakes |
| 16 | + "F", |
| 17 | + # pyupgrade |
| 18 | + "UP", |
| 19 | + # flake8-bugbear |
| 20 | + "B", |
| 21 | + # flake8-simplify |
| 22 | + "SIM", |
| 23 | + # isort |
| 24 | + "I", |
| 25 | + # pep8 naming |
| 26 | + "N", |
| 27 | + # pydocstyle |
| 28 | + "D", |
| 29 | + # annotations |
| 30 | + "ANN", |
| 31 | + # debugger |
| 32 | + "T10", |
| 33 | + # flake8-pytest |
| 34 | + "PT", |
| 35 | + # flake8-return |
| 36 | + "RET", |
| 37 | + # flake8-unused-arguments |
| 38 | + "ARG", |
| 39 | + # flake8-fixme |
| 40 | + "FIX", |
| 41 | + # flake8-eradicate |
| 42 | + "ERA", |
| 43 | + # pandas-vet |
| 44 | + "PD", |
| 45 | + # numpy-specific rules |
| 46 | + "NPY", |
| 47 | +] |
| 48 | +ignore = [ |
| 49 | + "ANN002", # Missing type annotation for `*args` |
| 50 | + "ANN003", # Missing type annotation for `**kwargs` |
| 51 | + "ANN101", # Missing type annotation for `self` |
| 52 | + "ANN102", # Missing type annotation for `cls` in classmethod |
| 53 | + "ANN201", # Missing return type annotation for public function (makes no sense for NoneType return types...) |
| 54 | + "ANN204", # Missing return type annotation for special method |
| 55 | + "D100", # Missing docstring in public module |
| 56 | + "D104", # Missing docstring in public package |
| 57 | + "D105", # Missing docstring in magic method |
| 58 | + "D107", # Missing docstring in `__init__` |
| 59 | + "D203", # 1 blank line before after class docstring |
| 60 | + "D204", # 1 blank line required after class docstring |
| 61 | + "D206", # Advised to disable by ruff-format |
| 62 | + "D211", # No blank line before class |
| 63 | + "D213", # Multiline summary second line |
| 64 | + "D413", # 1 blank line after parameters |
| 65 | + "E501", # Advised to disable by ruff-format |
| 66 | + "N802", # Function name should be lowercase; unittest uses mixed case |
| 67 | + "PD901", # Avoid using 'df' for pandas dataframes. Perfectly fine in functions with limited scope |
| 68 | + "SIM108", # Simplify if/else to one line; not always clearer |
| 69 | + "W191", # Advised to disable by ruff-format |
| 70 | + |
| 71 | + # These are issues which remain to be fixed |
| 72 | + "ANN001", # Missing type annotation for function argument |
| 73 | + "ANN202", # Missing return type for private function |
| 74 | + "ANN206", # Missing return type annotation for classmethod |
| 75 | + "ANN401", # Dynamically typed expressions (typing.Any) are disallowed |
| 76 | + "ARG002", # Unused method argument |
| 77 | + "B007", # Loop control variable not used within loop body |
| 78 | + "B008", # Do not perform function call in argument defaults |
| 79 | + "B018", # Found useless expression |
| 80 | + "B024", # <class> is an abstract base class, but it has no abstract methods |
| 81 | + "D101", # Missing docstring in public class |
| 82 | + "D102", # Missing docstring in public method |
| 83 | + "D103", # Missing docstring in public function |
| 84 | + "D200", # One-line docstring should fit on one line |
| 85 | + "D401", # First line of docstring should be in imperative mood |
| 86 | + "D404", # First word of the docstring should not be "This" |
| 87 | + "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks |
| 88 | + "ERA001", # Dead code |
| 89 | + "FIX002", # Line contains TODO, consider resolving the issue |
| 90 | + "PD011", # Use `.to_numpy()` instead of `.values` |
| 91 | + "PD013", # `.melt` is preferred to `.stack` |
| 92 | + "RET504", # Unncessary assignment before `return` |
| 93 | + "RET505", # Unncessary `else` after `return` statement |
| 94 | + "SIM101", # Multiple `isinstance` calls, merge into a single call |
| 95 | + "SIM102", # Use a single `if` statement instead of nested `if` statements |
| 96 | + "SIM105", # Replace with `contextlib.suppress(FileNotFoundError)` |
| 97 | + "SIM110", # Use `return all(...)` instead of `for` loop |
| 98 | + "SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements |
| 99 | + "SIM118", # Use `key in dict` instead of `key in dict.keys()` |
| 100 | + "UP008", # Use `super()` instead of `super(__class__, self)` |
| 101 | + "UP031", # Use format specifiers instead of percent format |
| 102 | +] |
| 103 | + |
| 104 | +[tool.ruff.lint.per-file-ignores] |
| 105 | +"__init__.py" = [ |
| 106 | + "F401", # Unused import |
| 107 | +] |
| 108 | +"*_test.py" = [ |
| 109 | + "ANN001", # Type annotations aren't needed for tests; these are fixtures or parametrizations |
| 110 | + "PT009", # Use a regular `assert` instead of a unittest-style `assertEqual` |
| 111 | + "PT027", # Use `pytest.raises` instead of unittest-style `assertRaisesRegex` |
| 112 | + |
| 113 | + # Missing docstrings; probably want to fill these out for tests. For now, we just disable |
| 114 | + "D101", # Missing docstring in public class |
| 115 | + "D102", # Missing docstring in public method |
| 116 | + |
| 117 | +] |
| 118 | + |
| 119 | +[tool.ruff.lint.pydocstyle] |
| 120 | +convention = "google" |
| 121 | + |
| 122 | +[tool.isort] |
| 123 | +profile = "black" |
0 commit comments