Open vemv opened 5 years ago
an alternative would be to suppress any printing and expecting a report for any action (formatting/linting) which can be handled more fine grained.
These reports could be manipulated to provide different styled outputs (grouped per file, colorized, reporting-levels, summaries, etc).
clj-kondo has a pretty pleasant API which returns a map like;
{:findings [{:level :error,
:type :unresolved-symbol,
:filename "taoensso/truss/impl.cljs",
:message "unresolved symbol e",
:row 200,
:col 35},
...],
:summary {:error 52, :warning 0, :info 0, :type :summary, :duration 173}}
Could be. Depends on what all formatters/linters actually do. I think some just println
, w/o offering a data-oriented API
As you probably know with-serialized-output
is a thing and it already successfully captures all 3rd party output. Out of that, mutating ../
(clojure.string/replace
) seems easy.
...Aligning not so much, but alignment would be just as hard with either approach
I think some just println, w/o offering a data-oriented API
That's true, but because we internally call the linters with 1 file only (usually), we could construct a bare minimum report {:filename ..., :message ..., col: 1, row: 1, :level :warning}
.
Aligning not so much, but alignment would be just as hard with either approach
I think alignment isn't that big of an issue if you have control over the output. I think per-file grouping of all lint-errors and format-messages is ideal for a clean outout
Drop
../
, align: