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

ReviewDog reporter for Mega-Linter #841

Open
nvuillam opened this issue Dec 30, 2020 · 4 comments
Open

ReviewDog reporter for Mega-Linter #841

nvuillam opened this issue Dec 30, 2020 · 4 comments

Comments

@nvuillam
Copy link

Hi, I am the maintainer of Mega-Linter, a linters aggregator for CI which embeds more than 70 linters that are run when applicable by CI (GitHub Actions and other CI tools )

During the run, I keep all logs from linters.

In your opinion:

  • how complicated would it be to integrate Mega-Linter with review dog ?
  • would it be possible to call reviewdog in "bulk" mode, to improve performances ? (i'm afraid to decrease them too much if I call it once by linter results)

Many thanks for your suppport :)

@ewencluley
Copy link

I would love this to be possible. I had spent some time looking at trying to get super-linter working with reviewdog but the main issue seemed to be that every different linter output is in a different format. Ive not tried megalinter yet but it actually seems a better fit in many regards (esp with the various flavours to avoid the super-linter 4GB image). I'm assuming the same variation in the linter output format would be present in megalinter too.

I was looking at writing parsers for the linter outputs to get them into a common format and then I was planning to cat the formatted outputs together and feed into reviewdog.

I guess the other approach would be to add input formats to reviewdog that were specific to the various linters but I felt that a consolidated output format from the linters would be a more flexible approach.

Im happy to work on this further (unless anyone has any better ideas) but while simple enough its probably going to be quite timeconsuming.

@nvuillam
Copy link
Author

nvuillam commented Mar 8, 2021

As far as I understand, ReviewDog can work with default format of linter reporters
Mega-Linter generates standalone files (or even strings) with the output of each linter
We can define custom reporters:

  • for whole Mega-Linter
  • for each linter

Starting from that, do you think it could be doable ?

I'd be glad to provide all support necessary, but I don't have myself a lot of time to implement myself for now (new job very time consuming)

@ewencluley
Copy link

Apologies for the delay in replying, had a busy week. Going to make some time tomorrow to look at this.

As long as we can get the output from mega linter to be consistent I think it would be possible. I think a good starting point for me would be to work out which output formats each linter in megalinter supports. If there are some commonalities between the supported formats then that would make it more straightforward.

For example checkstyle and hadolint both support checkstyle output format and review dog supports checkstyle input format. With this in mind it might be easiest to make megalinter reporters that produce a checkstyle compatible output. There may be some format that is supported even more broadly across linters, I will need to investigate.

Will be looking at this over in spare time between work so might take a while to get done.

@ewencluley
Copy link

I have opened a draft PR oxsecurity/megalinter#377 with a reporter that would output the Reviewdog JSONL format. Currently only supporting Flake8 and Black linters but will add more if the approach is deemed reasonable.

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

2 participants