diff --git a/pyproject.toml b/pyproject.toml index 033048730f..930db406b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -181,30 +181,59 @@ exclude_lines = [ line-length = 79 [tool.ruff.lint] select = [ - "D", # pydocstyle - "B", - "E", # pycodestyle - "F", # pyflakes - "I", # isort - "ISC001", # pycodestyle - "W", # pycodestyle + # "PL", + # "D", # pydocstyle + # "B", + # "E", # pycodestyle + # "F", # pyflakes + # "I", # isort + # "ISC001", # pycodestyle + # "W", # pycodestyle + "ALL", ] ignore = [ - "E501", # Disable line-too-long as this is taken care of by the formatter. - "D105", # Disable Missing docstring in magic method as these are well defined. + # Ignore until someone has time to fix this. + "ANN", # Adding type hints + "PTH", # Use pathlib everywhere + "PERF", # Use comprehensions + "PLR2004", # Don't use magic values + "PLW2901", # Don't overwite a loop variable + "PT009", # Use a regular `assert` instead of unittest-style `assertListEqual` + "PT011", # pytest.raises without match argument + "PT027", # Use `pytest.raises` instead of unittest-style `assertRaises` + "FBT", # avoid boolean positional arguments + "DTZ", # add tzinfo to datetimes + "PGH003", # Use specific rule codes when ignoring type issues + "SIM102", # Use a single `if` statement instead of nested `if` statements + "TD003", # Missing issue link on the line following this TODO + # Really ignore + "S603", # Uncheckable + "TD002", # Missing author in TODO: can be seen from git history + "FIX002", # TODOs can be useful when something cannot be done immediately. + "TRY003", # Fixing this would require many exceptions + "E501", # Disable line-too-long as this is taken care of by the formatter. + "D105", # Disable Missing docstring in magic method as these are well defined. ] [tool.ruff.lint.per-file-ignores] +"**.ipynb" = [ + "T20", # Printing things in notebooks is fine. +] "tests/**.py" = [ - "B011", # `assert False` is valid test code. + "S101", # Use of assert in tests code is required. + "T20", # Printing things can help with debugging tests. + "SLF001", # Testing private members is ok + "PLR2004", # Magic values in tests are fine. # Docstrings in tests are only needed if the code is not self-explanatory. - "D100", # Missing docstring in public module - "D101", # Missing docstring in public class - "D102", # Missing docstring in public method - "D103", # Missing docstring in public function - "D104", # Missing docstring in public package + "D100", # Missing docstring in public module + "D101", # Missing docstring in public class + "D102", # Missing docstring in public method + "D103", # Missing docstring in public function + "D104", # Missing docstring in public package ] [tool.ruff.lint.isort] known-first-party = ["esmvalcore"] +[tool.ruff.lint.pylint] +max-args = 7 [tool.mypy] # See https://mypy.readthedocs.io/en/stable/config_file.html