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

move rubocop into foreman.yml #9924

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Nov 24, 2023

No description provided.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on combining RuboCop with matrix building?

ruby-version: 2.7
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop -P
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When rubocop is >= 1.2 you can use --format github to get GH annotations, but we'd need to update theforeman-rubocop from 0.0.6 to 0.1.x. We should add that to the list of updates to perform: theforeman/theforeman-rubocop#8 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, updating tfm-r would be good.

@evgeni
Copy link
Member Author

evgeni commented Nov 24, 2023

Any thoughts on combining RuboCop with matrix building?

You mean "in the same step"? I'd leave it separated for visibility reasons.

@ekohl
Copy link
Member

ekohl commented Nov 24, 2023

If you separate it out, would it make sense to reuse https://github.com/theforeman/actions/blob/v0/.github/workflows/rubocop.yml? And perhaps also run it after matrix building. So it's

  • setup_matrix
  • rubocop
  • tests
  • dummy

Then in rubocop you can use matrix.ruby[0] to get the Ruby version. If so, we should adopt the policy to always list the newest Ruby version first.

@evgeni
Copy link
Member Author

evgeni commented Nov 24, 2023

Does the Ruby version we run Rubocop with really matter (as long it's a compatible one)?
(Remembering to keep the Rubies sorted will be hard, but I think it just doesn't matter which one we pick)

@ekohl
Copy link
Member

ekohl commented Nov 24, 2023

Not a lot. The reuse of the matrix is more important than the exact order. Newest for RuboCop is IMHO preferred, but not required.

@evgeni
Copy link
Member Author

evgeni commented Nov 27, 2023

There you go.

I briefly considered to run Rubocop for all rubies (like, you know, with a real matrix), but then could not find a good reason to do so.

@ekohl ekohl merged commit b3b6aa3 into theforeman:develop Nov 27, 2023
13 of 14 checks passed
@evgeni evgeni deleted the merge-rubocop branch November 27, 2023 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants