Closed nschonni closed 2 years ago
Also, I wonder if we should use problem matchers or parse the stdout/stderr of the shell command and then core.warn
(this will give us more control than the matcher, which is limited to regex).
Also, I wonder if we should use problem matchers or parse the stdout/stderr of the shell command and then
core.warn
(this will give us more control than the matcher, which is limited to regex).
From https://github.com/actions/toolkit/issues/186 it looks like there may not be an easy way to do this right now. But from there, it does look like there is a similar "echo" approach that can do it
We can use core.warning(msg, { file, title, startLine })
(similarly for core.error
and core.notice
).
See https://github.com/actions/toolkit/blob/daf8bb00606d37ee2431d9b1596b88513dcf9c59/packages/core/src/core.ts#L245.
I think i've taken this one as far as I can. If you've got a different approach you'd like, feel free to close
Sorry if this exercise felt annoying. My concern with the matcher approach is that it'll end up adding the annotations to wrong file (a file that doesn't exist in repo) unless we rename the file before running validator. With the JS based approach, we can use a different filename as I mentioned in https://github.com/w3c/spec-prod/pull/120#issuecomment-1004268114 and use lineNumber = 1
so the annotations are added to top of source file (and not at wrong place as per the generated output file).
If there is no matching file, GitHub doesn't add annotations to the UI, so it won't change anything for those that don't have the generated files in the source
Ah! I didn't know that!
But then what benefit does it add, as:
EX: https://github.com/w3c/screen-wake-lock it's running on the HTML file in the source, so the line numbers will be correct and work. Something like https://github.com/w3c/gyroscope that uses Bikeshed into another branch, just won't show file level annotations
Sorry, but the examples you've shared both run the validator on generated output files.
index.html
.main
branch.Just to be clear, here's what spec-prod does:
Step 2 above is the reason why line numbers will always be wrong, unless there's some sort of sourcemap generation by ReSpec/Bikeshed that vnu can use.
I'm inclined to close this PR for now, but I'll open an issue for this feature.
Copied over from aria-practices where it's already used. Not sure if there is a better location to place the JSON file though