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

A new formatter for GitHub Actions #8004

Closed
ybiquitous opened this issue May 21, 2020 · 2 comments · Fixed by #8981
Closed

A new formatter for GitHub Actions #8004

ybiquitous opened this issue May 21, 2020 · 2 comments · Fixed by #8981

Comments

@ybiquitous
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I have the following workaround to run RuboCop on GitHub Actions and show detected RuboCop issues to a pull request page:

https://gist.github.com/ybiquitous/72a1d7cf0eb9bbb9255d84d1ee904881

I think there are the following problems:

  • Regex written in the workaround above is complicated and hard to read and maintain.
  • Users who don't know the workaround cannot easily use RuboCop in Actions.

Describe the solution you'd like

Add a new formatter for GitHub Actions.

Describe alternatives you've considered

Add a description of the usage on GitHub Actions to the RuboCop documentation.

Additional context

Here are the GitHub Actions' messaging specs:

RuboCop has more severities than warning and error, so we need to map RuboCop's severities and GitHub Actions' severities. For example:

RuboCop GitHub Actions
refactor warning
convention warning
warning warning
error error
fatal error
@xorima
Copy link

xorima commented May 21, 2020

Hey,

I run actionshub on github and we had this type of issue already around cookstyle (Chef extended Rubocop) and use the following code as a fix: https://github.com/actionshub/chef-delivery/blob/master/cookstyle.json

Now if there is the want I can extend this or create an action to cover rubocop directly?

Thanks

Jason

lautis added a commit to lautis/rubocop that referenced this issue Nov 1, 2020
Implement a formatter for GitHub Actions. When using this formatter
within GitHub Actions, GitHub shows detected RuboCop issues on pull
request page as annotations.

The formatter uses `fail_level` to determine which GitHub level to use
for each annotation. By default, all RuboCop severities are errors. If
fail level is set and severity is below fail level, a warning will be
created instead.
bbatsov pushed a commit that referenced this issue Nov 1, 2020
Implement a formatter for GitHub Actions. When using this formatter
within GitHub Actions, GitHub shows detected RuboCop issues on pull
request page as annotations.

The formatter uses `fail_level` to determine which GitHub level to use
for each annotation. By default, all RuboCop severities are errors. If
fail level is set and severity is below fail level, a warning will be
created instead.
@ybiquitous
Copy link
Contributor Author

Thank you so much! I can't wait for the next release! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants