Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally formatting output for machine-readability? #569

Open
chriselrod opened this issue Oct 17, 2023 · 0 comments
Open

Optionally formatting output for machine-readability? #569

chriselrod opened this issue Oct 17, 2023 · 0 comments

Comments

@chriselrod
Copy link

chriselrod commented Oct 17, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant