Skip to content

Add Fortran/Fypp static analysis linter to catch copy-paste bugs #1211

Description

@sbryngelson

Feature Request

Add a Python-based static analysis linter for Fortran/Fypp source code that catches patterns known to cause silent bugs. Integrate it into the pre-commit hook (`./mfc.sh precheck`) and CI (`lint-source.yml`).

Proposed Checks

Check What it catches
Fypp list duplicates Duplicate entries in `#:for VAR in [...]` broadcast/loop lists
Duplicate consecutive lines Identical adjacent non-trivial lines (copy-paste errors)
Hardcoded byte size `int(8._wp, ...)` patterns that assume 8-byte reals

These checks are motivated by real bugs found in the codebase. The linter would prevent regressions after the bugs are fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions