Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new output format that can be selected using
--output_format
flag of the linter.The format is described here:
https://github.com/reviewdog/reviewdog/tree/master/proto/rdf
It comes in two versions:
rdjson
is a JSON that contains one object for the whole linting process, with all violations and fixes inside.rdjsonl
uses JSON Lines to print separate JSON objects for each violation.We use the second one (
rdjsonl
).The content is the same, but this format is easier to produce considering the current interface of
ViolationHandler
in Verible.This is done:
There is a class named
RDJsonPrinter
which implementsViolationHandler
interface with rule violations and fixes if they exist.The output is interpreted by Reviewdog as expected, which can be seen here:
antmicro/gha-playground#102
Some code related to
ViolationHandler
has been moved fromverilog
tocommon
.It seemed like placing
RDJsonPrinter
insideverilog
wouldn't be a good idea, so I've used the occasion to refactor these things.This isn't done yet:
The
--output_format
isn't integrated with the--autofix
option correctly.Currently
RDJsonPrinter
will always include autofixes in the output, and will be selected only if you don't select any--autofix
option.Selecting
--autofix=<patch or some other way to fix>
results in producing the standard plain text output,so If you'd like to check out this feature, please just use
--output_format=rdjson
.Also,
rdjson
is to be renamed tordjsonl
so that it's the same name as in Reviewdog.The name of the standard format is currently
plain
, and that's the default value.I think
plain
,text
,plaintext
are worth considering.However, I don't think this is the ultimate name and any feedback on this topic would be much appreciated.