-
Notifications
You must be signed in to change notification settings - Fork 4
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
More output options #41
Comments
Yes, these both sound like good ideas. As far as parsing the output of commands that it runs, I'd be up for that too. I suspect the best one to implement would be (and I hate to say this) checkstyle XML parsing. I'd love to go with JSON but just looking at eslint & and golangci-lint I can see that they're just making up their own schemas, so that's not really viable. What I don't want to do is have a custom parser for each tool. Looking at the checkstyle output, it has all the info that is needed to turn this into GitHub annotations. Making precious output something else wouldn't be too hard. Right now it only prints non-logging output in a few spots, so changing that to use some sort configurable thing would be pretty easy. As far as formats, as much as I'd love to use JSON, but absent any standard I don't see much point. I think checkstyle is probably the best bet for this too. |
It'd probably be good to do a survey of other tools as well just to see if they all support checkstyle too. |
For both of these, it might make sense to design the configuration and code so that additional formats could potentially be added fairly easily in the future. In terms of supporting JSON output, I think the primary advantage of that is making it easy for the user to transform the output into whatever they want. Of the other tools that I use:
|
I started working on this locally and I'm implementing it with a new As far as JSON vs something else, the checkstyle XML is very simple. Here's an XSD for it - https://github.com/linkedin/pygradle/blob/master/pygradle-plugin/src/test/resources/checkstyle/checkstyle.xsd But when I was talking about checkstyle, I was mostly talking about implementing parsing in precious. It seems like parsing checkstyle and using that to either emit GH annotations directly or to bundle it all into one giant checkstyle output might be useful. |
Oh, ignore that action. I think it's parsing checkstyle's non-XML output or something. This one seems to be what I was hoping existed - https://github.com/marketplace/actions/push-checkstyle-report |
After spending some time looking at checkstyle, I've concluded that it's not great. It only handles errors, so there's no way to indicate that a file was tidied, or that a file was lint-clean. I guess custom JSON it is, then. |
The most recent release added support for GitHub workflow commands. Would you be open to supporting other output formats? The Checkstyle or JUnit XML formats would be nice given that there is a lot of tooling that supports them already, but even a JSON format that is easily machine readable would be useful.
Another thought is that many linting tools already support various output formats. For instance,
golangci-lint
:ESLint supports many of the same formats.
Precious could potentially support reading in one of these machine-readable formats to improve its own output and allow lints to be associated with a particular line or character.
The text was updated successfully, but these errors were encountered: