Skip to content

Code quality improvement, investigate ignored failures #437

Open
@stephenworsley

Description

@stephenworsley

Repo-review

Numpydoc

Ruff

  • "ANN001", "ANN002", "ANN003", "ANN101", "ANN201", "ANN202", "ANN204", # Missing type annotations
  • "B904", # Try except handling (Fix try except handling #510)
  • "C408", # Unnecessary dict call (Ruff/numpydoc fixes #439)
  • "C901", # McCabe complexity (Ruff/numpydoc fixes #439)
  • "D104", # Misssing docstring
  • "E501", # Line too long
  • "EM101", "EM102", # Exceptions using string literals (Ruff/numpydoc fixes #439)
  • "ERA001", # Commented out code
  • "F401", "F403", # imports not used, consider adding to all
  • "FBT002", # Boolean default positional argument in function definition
  • "FIX002", # Line contains TODO
  • "FLY002", # Replace join with f-string (Ruff/numpydoc fixes #439)
  • "INP001", # Missing init (Replace asserts #508)
  • "N802", "N806" # Upper case names
  • "PERF401", # Use a list comprehension to create a transformed list (Ruff/numpydoc fixes #439)
  • "PLR0912", "PLR0913", "PLR0915", # Too many branches, arguments, statements (Ruff/numpydoc fixes #439)
  • "PLR2004", # Magic value used in comparison
  • "PLW2901", # for loop target overwritten by assignment target (Ruff/numpydoc fixes #439)
  • "PYI024", # Use typing.NamedTuple instead of collections.namedtuple (Ruff/numpydoc fixes #439)
  • "RET504", # Unnecessary assignment before return
  • "S101", # Use of assert (Replace asserts #508)
  • "SIM108", # Use ternary operator instead of if-else-block
  • "SLF001", # Private member accessed
  • "TD002", "TD003", # Incomplete TODOs
  • "TID252", # Prefer absolute imports over relative imports from parent modules (Ruff/numpydoc fixes #439)
  • "TRY003", # Avoid specifying long messages outside the exception class

per file:

tests

  • "B006", # Do not use mutable data structures for argument defaults
  • "N999", # Invalid module name
  • "PT006", "PT007", # Wrong types passed to @pytest.mark.parametrize (Ruff/numpydoc fixes #439)
  • "PT011", # pytest.raises(ValueError) is too broad
  • "PTH118", "PTH123", # Replace os with Path
  • "S101", # Use of assert

benchmarks

  • "ANN205", # Missing type annotations
  • "ARG001", "ARG002", # Unused arguments
  • "B018", # Found useless expression
  • "B028", # No explicit stacklevel keyword argument found
  • "D102", "D103", # Missing docstring
  • "DTZ005", # datetime.datetime.now() called without a tz argument
  • "PLW1510", # subprocess.run without explicit check argument
  • "PTH107", "PTH110", # Replace os with Path
  • "RET503", # Missing explicit return at the end of function able to return non-None value
  • "RUF005", # Consider replacing concatenation
  • "RUF012", # Mutable class attributes should be annotated with typing.ClassVar
  • "S101", # Use of assert
  • "S603", "S607", # Untrusted subprocess call
  • "TRY002", # Create your own exception

conf

  • "A001", # shadowing python builtin
  • "E402", # Module level import not at top of file
  • "DTZ005", # datetime.datetime.now() called without a tz argument

noxfile

  • "FBT001", # Boolean-typed positional argument in function definition
  • "PIE810", # Call startswith/endswith once with a tuple (Ruff/numpydoc fixes #439)
  • "S310", # Audit URL open for permitted schemes. Allowing use of file: or custom schemes is often unexpected.
  • "S506", # Consider yaml.safe_load
  • "SIM105", # Use contextlib.suppress(FileExistsError) instead of try-except-pass
  • "T201", # print found

setup

  • "EXE001", # Shebang is present but file is not executable

Metadata

Metadata

Labels

New: IssueHighlight a new community raised "generic" issue

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions