-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Adding Problem Matchers to display compilation errors as annotation. #27
Comments
30 seconds testing suggests it works: But due to the alternative path it doesn't correctly match and find the files out of the box. I think fromPath will fix that, but needs a bit more digging: |
Way cool! This is something I've been thinking about for a while, but never got around to investigating.
You're right that the library file paths in the compiler output don't match with the path in the repository due to the action having installed the library. However, it seems to find it anyway, I don't know how: In your demo, I think the problem is that the library code isn't in the commit diff. |
Heh, in some ways they are the main benefit I see to actions over where I was using Travis before for stuff, and I guess some slightly tighter integration of which specific task failed without having to visit another webpage.
Indeed it does. I wonder if it just matches the right hand side somewhere in the path?
Ah yes, possibly, they seem to keep changing their mind on how that all behaves, I've definitely seen flake8 runs annotate for errors in bits of code that weren't changed in the commit/PR. I guess I better open a PR then... Probably need to see if that's actually the best GCC problem matcher available first... |
Yes:
Although I haven't seen it, a boards platform author could use |
I've been doing a bit more investigation and experimentation with problem matchers lately. I am now using Although I think they are really cool and useful, I also see some issues caused by the use of problem matchers: Warnings might have already been in the project prior to the contribution, and in some cases not represent a real problem, but them being surfaced in the pull request context could cause contributors to think they indicate a problem with the pull request. Another problem I've encountered is related to my standard practice is to add both a These things mean there is a potential for problem matchers to make a project less contributor friendly. My feeling is that the maintainers of Arduino library and sketch repositories should put extra attention to making them approachable to those who are just getting started with contributing to open source projects. So I'm not yet decided on whether I think it's a good idea to add a warning level problem matcher to Arduino's own sketch compilation workflows. I think it would at least be worth considering use of an error-only problem matcher though. I don't see a strong benefit in this action having a built-in problem matcher capability when it's reasonably easy to add and maintain this capability by adding an extra step or two to the workflow. So I'm leaning towards thinking that this is out of scope for this repository. Do you have any thoughts on that @peternewman and @aentinger? |
In which case you may want to match linker output too.
I'm a bit curious of the benefit of this over just using the native actions. I guess it gives a more raw option to choose your own CLI options.
Yes, fair point, especially with warnings. I wonder if there's a clever tool already, or it could be added to https://github.com/liskin/gh-problem-matcher-wrap or similar, to grep out lines depending on at least which file they were in, or possibly if they were lines touched by the PR.
Agreed, it's certainly irritating. This seems to be a relevant issue, with no obvious movement from GitHub:
Yes, as you say, error ones seem a no-brainer. I guess my more general thought is you should probably have a matcher for everything that's going to stop a PR being merged. If you require lint, or sorting or some warnings to be clean, then flagging it as annotation seems far more friendly to me than expecting someone to read through CI output and understand what's at fault. Even something like codespell, there's a lot of noise in the action compared to just a list of typos.
My thinking is the actions should make things easy for the developers deploying them, if we're agreeing error matchers are beneficial, why not have them built into this by default, maybe with an option to match errors/errors+warnings/nothing. At the very least, it would be good to recommend a particular annotation and give an example of how to set it up along with this action. |
Please can we have problem matchers? I assume there isn't some reason you aren't using them?
Given it's a composite action, it looks like it's probably as simple as loading https://github.com/marketplace/actions/gcc-problem-matcher before compiling.
The text was updated successfully, but these errors were encountered: