Skip to content

Adopt ruff linting (would have caught the un-raised-exception pattern) #791

Description

@cailmdaley

Motivation

PR #789 (fixing #785) found the same bug — an exception constructed but never raised, silently falling through an error path — at five independent sites across the codebase (psfex_interp_runner.py, mccd_interp_runner.py ×2, mask_package/mask.py, pipeline/file_handler.py, pipeline/file_io.py). Ruff's PLW0133 (useless-exception-statement) flags exactly this pattern; a linter in CI would have caught all five at introduction time.

Proposal

  • Add ruff to the dev tooling with a conservative initial rule set (e.g. E, F, PLW0133 and friends) — start narrow, expand as the codebase is cleaned.
  • Wire it into CI so new violations block, without requiring a big-bang cleanup of existing code (per-file ignores or --diff-scoped enforcement).

Sibling precedent: sp_validation has a project-wide ruff pass planned (CosmoStat/sp_validation#204).

— Claude (Fable) on behalf of Cail

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions