fortran-linter icon indicating copy to clipboard operation
fortran-linter copied to clipboard

Allow certain rules to be deactivated

Open cphyc opened this issue 4 years ago • 1 comments

It would be great to be able to deactivate certain rules (similarly to how flake8 rules can be deactivated).

cphyc avatar Nov 05 '21 20:11 cphyc

+1 to this. The usual method is to have a .fortran-format.yaml where you read the rules you want to add/remove. Maybe check cmake-format for some tips.

Some implementation notes:

  • Split the fortran-format from fortran-lint. E.g. comment formatting would be in fortran-format not in the latter
  • Read a .fortran-format.yaml (or json, or etc.) for the default format/lint rules of the project
  • For fortran-format:
    • Add regex syntax to ignore a comment block. (cmake-format reference
    • Toggle off parsing for first comment block. This is usually a copyright header.
  • For fortran-lint:
    • Maybe coordinate with flint to codify the naming
    • Disable linting if a fortran-lint on/off block is defined (like clang-format) or if a specific lint command is specified (like clang-tidy)

LecrisUT avatar Jan 26 '23 15:01 LecrisUT