-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add --format option #159
Add --format option #159
Conversation
I'm looking into this to configure ale and CI to have a consistent style across all projects. |
Looks good. Can you document this new option in the README? |
@rafaelfranca Done. I did one more little thing, I've extracted the responsibility of show preview messages like |
Hello, Is there any progress on merging this change? We are migrating our CI to github actions, and the ability to write a custom reporter would make annotating errors in the changed files view a lot easier. No rush if this is still a WIP. |
With the newly released 0.0.36, this PR seems to introduce an error:
|
Oh boy, I'll check this out soon |
Hey guys!
At my work, we adopted this gem and we are trying to integrate it with this guy: https://github.com/reviewdog/reviewdog in our CI. But, it has been really hard to do, because this tool uses vim's errorformat and it's not that easy to parse the actual output.
I've seen that there are two proposals to tackle this problem: #84 #116, and it hasn't been any movement, so I decided to do this starting point.
This implementation that I've made is strongly inspired by these PRs.
I've added a
--format
option, with that, users can pass the desired output format. To add a new format is straightforward, you just need to create a new inherited class fromReporter
and implement the methodshow
and it will be available on cli automatically.So, I've refactored and extracted all the code responsible for reporting results in 2 new classes:
1 -
MultilineReporter
- The default report format2 -
CompactReporter
- Oneliner report, outputs data using format:file:line:column: message
. This guy will be really useful for many kinds of integrations like CI, editors, etc. 😃This opens the way to include new output formats more easily, like JSON, XML, etc.