fortran-lang/vscode-fortran-support

feat: Integrate fortitude linter

blaylockbk opened this issue · 1 comments

Is there an existing request for this?

  • I have searched the existing issues

I have tried the Pre-Release of the extension.

  • Feature is not present in the latest Pre-Release

Feature Request

The fortitude Fortran linter project just popped up in my GitHub feed. Could it be integrated in the VS Code extension?
https://github.com/PlasmaFAIR/fortitude

I have a very basic implementation using the tasks.json (this is my first time ever attempting such a thing, so I'm not sure if it is the best implementation). It would be amazing if the Modern Fortran extension could take care of this.

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Fortitude Check",
            "type": "shell",
            "command": "${env:HOME}/miniforge3/envs/fortran-tools/bin/fortitude", // Edit with path to your fortitude
            "args": [
                "check",
                "${fileDirname}"
            ],
            "runOptions": {
                "runOn": "folderOpen"
            },
            "problemMatcher": {
                "owner": "Fortitude",
                "fileLocation": "relative",
                "source": "Fortitude",
                "pattern": {
                    "regexp": "^(.*?):(\\d+):(\\d+):\\s(\\w+)\\s(.+)$",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "code": 4,
                    "message": 5
                }
            },
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "reveal": "never",
                "panel": "shared"
            }
        }
    ]
}

I had to use the "Trigger Task on Save" extension to apply the linting whenever I save. This was added to my settings.json

"triggerTaskOnSave.tasks": {
        "Fortitude Check": ["*.f90"]
    },