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

Add --format github option #1793

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Add --format github option #1793

merged 1 commit into from
Nov 8, 2024

Conversation

r7kamura
Copy link
Contributor

How about adding reek --format github CLI option, like rubocop --format github or brakeman --format github?

This would make it very convenient for users in GitHub Actions, as they would be able to see violations on pull request diff page and GitHub Checks page.

@mvz
Copy link
Collaborator

mvz commented Oct 28, 2024

@r7kamura I'm not familiar with this GitHub feature. Do you have any background info?

@r7kamura
Copy link
Contributor Author

r7kamura commented Oct 28, 2024

In GitHub Actions, when a message of the following form is written to standard output, GitHub will recognize it as a single warning annotation. (some parameters are optional; I chose warning this time, but maybe error would be better)

::warning file={name},line={line},endLine={endLine},title={title}::{message}

Detailed documentation can be found at:

The presence of this annotation will automatically annotate the diff page of the associated pull request; in the case of reek, this means that when the offending code is added, the details of the violation will be annotated there.

Here is an example of this in action:

Screenshots:

image

image

@mvz
Copy link
Collaborator

mvz commented Oct 28, 2024

Thanks @r7kamura, that looks really useful! @troessner WDYT?

@troessner
Copy link
Owner

Pretty cool, didn't know about this as well, PR looks good to me! LGTM @mvz ?

@mvz
Copy link
Collaborator

mvz commented Nov 8, 2024

:shipit:

@mvz mvz merged commit 004ed82 into troessner:master Nov 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants