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

GitHub action check annotation #480

Closed
Boshen opened this issue Jun 26, 2023 · 11 comments · Fixed by #3191
Closed

GitHub action check annotation #480

Boshen opened this issue Jun 26, 2023 · 11 comments · Fixed by #3191
Assignees
Labels
A-linter Area - Linter E-Help Wanted Experience level - For the experienced collaborators good first issue Experience Level - Good for newcomers

Comments

@Boshen
Copy link
Member

Boshen commented Jun 26, 2023

Biome has implemented this: https://biomejs.dev/blog/biome-v1-5/#the-command-biome-ci-now-prints-diagnostics-in-github-prs

This was referenced Jun 26, 2023
@Boshen Boshen added E-Help Wanted Experience level - For the experienced collaborators A-linter Area - Linter good first issue Experience Level - Good for newcomers labels Nov 5, 2023
@jbergstroem
Copy link

jbergstroem commented Nov 9, 2023

@Boshen another approach could be to check in the environment for GITHUB_ACTION and output the ::error string(s) as part of stdout. That way you' run the binary in CI and it'd Just Work.

@re-taro
Copy link
Contributor

re-taro commented Feb 17, 2024

@Boshen Hello! I would like to address this issue!

@Boshen
Copy link
Member Author

Boshen commented Feb 18, 2024

@Boshen Hello! I would like to address this issue!

Assigned 😁

@re-taro
Copy link
Contributor

re-taro commented Feb 18, 2024

@Boshen Hello! I would like to address this issue!

Assigned 😁

Thanks! By the way, where should I create a repository?

  • First, I'll create it privately, and if @Boshen decides it's a good idea, I'll import it into oxc-project.
  • Create it in oxc-project from the beginning

@Boshen
Copy link
Member Author

Boshen commented Feb 18, 2024

@re-taro Do you wanna take a look at how biome does it? It seems like all we need to do is detect for github CI and dump things differently

@Boshen another approach could be to check in the environment for GITHUB_ACTION and output the ::error string(s) as part of stdout. That way you' run the binary in CI and it'd Just Work.

@Boshen
Copy link
Member Author

Boshen commented Feb 18, 2024

The text should be wrapped here I think

output.push_str(&err);

@re-taro
Copy link
Contributor

re-taro commented Feb 18, 2024

@re-taro Do you wanna take a look at how biome does it? It seems like all we need to do is detect for github CI and dump things differently

@Boshen another approach could be to check in the environment for GITHUB_ACTION and output the ::error string(s) as part of stdout. That way you' run the binary in CI and it'd Just Work.

Ah, I see, my apologies, you mean to respond with a Biome-like approach. Yes, sir.

@Boshen Boshen changed the title GitHub action with check annotation GitHub action check annotation Feb 18, 2024
@re-taro
Copy link
Contributor

re-taro commented Feb 22, 2024

hmm... If you can escape &err_str and get file name, line number and column number in output.push_str(&err_str); inside crates/oxc_diagnostics/src/service.rs It would be nice, but it is not simple because line number and column number are obtained in crates/oxc_diagnostics/src/graphic_reporter.rs and are nicely hidden.

@Boshen
Copy link
Member Author

Boshen commented Feb 23, 2024

hmm... If you can escape &err_str and get file name, line number and column number in output.push_str(&err_str); inside crates/oxc_diagnostics/src/service.rs It would be nice, but it is not simple because line number and column number are obtained in crates/oxc_diagnostics/src/graphic_reporter.rs and are nicely hidden.

Can you help me with what's needed to be printed / outputted on the screen?

@jbergstroem
Copy link

Can you help me with what's needed to be printed / outputted on the screen?

https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message

@re-taro
Copy link
Contributor

re-taro commented Feb 23, 2024

Sorry for the hassle. As @jbergstroem posted the link, you need to get the file name, column number and line number inside crates/oxc_diagnostics/src/service.rs (if you wrap output.push_ str(&err_str); if you wrap it...). For workflow-command, you can get it from diagnostic.severity().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter E-Help Wanted Experience level - For the experienced collaborators good first issue Experience Level - Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants