PlasmaFAIR / fortitude

A Fortran linter, written in Rust and installable with Python.
MIT License
39 stars 1 forks source link

Fixed format files #78

Open ZedThree opened 1 month ago

ZedThree commented 1 month ago

I need to finish updating the fixed-format grammar, and then we will be able to handle fixed-format files as well.

We'll also need a setting to map file extensions to free- or fixed-format. For example, c2pk uses .F, gs2 uses .fpp, and other projects use .f90 for free-form preprocessor files.

LiamPattinson commented 1 month ago

Will we have to add tags to mark rules as fixed/free-format? Or will we just recommend that fixed-format be converted to free-format, and use the same lints?

Also, will this need a new tree-sitter extension, or is the plan to have tree-sitter-fortran handle both?

ZedThree commented 1 month ago

There's a separate grammar for fixed format, as there are a couple of important syntax differences.

Might need tags for different rules. Definitely good to have a rule to recommend converting to free form. There are some tools out there to do this automatically, but if there's nothing suitable, it would make a good subcommand. The ASTs should be pretty similar between the two forms, so rewriting shouldn't be too difficult -- hackathon project?

Currently we (mostly) do string comparison for node minds, which should be fine between the two formats, but if we wanted to switch to kind IDs, then they might be different and require more careful handling.

On Wed, 9 Oct 2024, 13:57 LiamPattinson, @.***> wrote:

Will we have to add tags to mark rules as fixed/free-format? Or will we just recommend that fixed-format be converted to free-format, and use the same lints?

Also, will this need a new tree-sitter extension, or is the plan to have tree-sitter-fortran handle both?

— Reply to this email directly, view it on GitHub https://github.com/PlasmaFAIR/fortitude/issues/78#issuecomment-2402248769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALLAXUTEX2EYLCICQNMU2LZ2UR3BAVCNFSM6AAAAABPUKOHQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBSGI2DQNZWHE . You are receiving this because you authored the thread.Message ID: @.***>