aviatesk / JET.jl

An experimental code analyzer for Julia. No need for additional type annotations.

Home Page:https://aviatesk.github.io/JET.jl/dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optionally formatting output for machine-readability?

chriselrod opened this issue · comments

Many editors may have easy integration with linters if their output can match a specific format. For example, kak supports defining lintcmd:

declare-option \
    -docstring %{
        The shell command used by lint-buffer and lint-selections.

        It will be given the path to a file containing the text to be
        linted, and must produce output in the format:

            {filename}:{line}:{column}: {kind}: {message}

        If the 'kind' field contains 'error', the message is treated
        as an error, otherwise it is assumed to be a warning.
    } \
    str lintcmd

such as

hook global WinSetOption filetype=cpp %{
    set-option window lintcmd "cppcheck --language=c++ --enable=warning,style,performance,information --template='{file}:{line}:{column}: {severity}: {message}' 2>&1"
}

which lets me run :lint in the editor when looking at a file to get cppcheck's static analysis on top of clang-tidy/the language server.
The editor uses the output to show the diagnostics with the code, and also present them in another buffer with the filenames+line-numbers as links.

As a manually executable command, it is appropriate for slower analysis (i.e. you might not want to run JET constantly as you type, but that's generally fine with the LSP).

So I'd like JET to be able to output report_package results following the format {filename}:{line}:{column}: {kind}: {message} (I'd of course use executable script to drive JET, probably with DaemonConductor.jl or DaemonMode.jl).

Someone with knowledge on VSCode extensions should chime in on what it may expect, ideally we'd have something that makes it easy for lots of people to use it as a plugin for their editor.