We’ve just released a new version of Fortitude, our Fortran linter based on Ruff. This release has been all about configurability, featuring improvements to fortitude.toml /fpm.toml configuration files and adding new options such as file filtering and per-line/per-file rule ignores. It also adds 25 new rules – the full list is available here.
One significant change is that we’ve re-categorised a large number of our rules, so a lot of previous rule codes have been remapped (e.g. T001 → C001 ). We’ve automated the redirection of old codes to minimise breakages to existing workflows, but there are likely some edge-cases we didn’t consider, so please let us know if you run into any trouble migrating to the new version. We’ve turned some rules off by default, and several new rules are in preview mode, so if you want to turn everything on, feel free to try --select=ALL --preview to get all 50+ rules!
The roadmap for 0.8.0 includes editor integration with LSP, improved preprocessor support, and a formatting mode. Please let us know if you’re particularly keen to see any of these, or if there’s any other features or new rules you’d love to see! Pull requests are always welcome!
If by formatting mode you mean the ability to just apply all given rules to a file, then that would be very nice. We currently use flint, but that only gives us a list of issues.
Sorry, I meant a formatter like fprettify, or black for Python.
We do have auto-fixes for a bunch of rules (but not all), you can apply with them --fix. Some fixes also require setting --unsafe-fixes as it’s possible they will change the meaning of your code. See the list of rules for which ones have auto-fixes available.
Can I ask which rules in flint you find most useful and would like auto-fixes for?
The idea would be to mark x(1) (a legacy convention for arrays of unspecified length) variables as candidates for upgrade to x(*), when x appears as a procedure dummy argument.