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

Use Rubocop's Github Actions formatter if possible #340

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

ekohl
Copy link
Contributor

@ekohl ekohl commented Jun 21, 2021

Rubocop 1.2 introduced a Github Actions formatter which creates annotations. This change uses it when it runs on Github Actions and Rubocop is new enough.

Currently a draft since I haven't tried this yet.

Rubocop 1.2 introduced a Github Actions formatter which creates
annotations. This change uses it when it runs on Github Actions and
Rubocop is new enough.
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2021

Codecov Report

Merging #340 (96dcd84) into main (cbad6f4) will decrease coverage by 0.42%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #340      +/-   ##
==========================================
- Coverage   43.28%   42.85%   -0.43%     
==========================================
  Files          11       10       -1     
  Lines         841      770      -71     
==========================================
- Hits          364      330      -34     
+ Misses        477      440      -37     
Impacted Files Coverage Δ
lib/puppetlabs_spec_helper/puppet_spec_helper.rb 65.51% <ø> (ø)
lib/puppetlabs_spec_helper/tasks/fixtures.rb 38.36% <ø> (ø)
lib/puppetlabs_spec_helper/rake_tasks.rb 42.50% <63.15%> (+1.03%) ⬆️
...bs_spec_helper/puppetlabs_spec/puppet_internals.rb 92.50% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a3b2473...96dcd84. Read the comment docs.

@da-ar
Copy link

da-ar commented Jun 21, 2021

Thanks for the PR it looks to work well.
It appears that if you run rubocop within a matrix it will annotate the same error for each item in the matrix.

@ekohl
Copy link
Contributor Author

ekohl commented Jun 21, 2021

Thanks for checking that. I don't think it would affect us really (Voxpupuli) since we only run Rubocop once in a validation step before we run the actual tests: https://github.com/voxpupuli/modulesync_config/blob/5e2741cfc0472da80146c50782abef3c2b567a6e/moduleroot/.github/workflows/ci.yml.erb#L6-L29. Is it a concern for others that we need to solve? I'd recommend everyone to only run validation steps once, just to save CI resources.

@ekohl
Copy link
Contributor Author

ekohl commented Jun 22, 2021

So I opened puppetlabs/pdk-templates#441 to start the discussion.

@da-ar
Copy link

da-ar commented Jul 5, 2021

@ekohl currently waiting for puppetlabs/pdk-templates#441 to progress. If it goes in, then I'm happy for this to be merged also.

@da-ar
Copy link

da-ar commented Jul 19, 2021

@ekohl puppetlabs/pdk-templates#441 has been merged so If you are happy to take this PR out of draft i'll get it merged. TY.

@ekohl ekohl marked this pull request as ready for review July 19, 2021 09:57
@ekohl ekohl requested review from a team as code owners July 19, 2021 09:57
@da-ar da-ar merged commit 9c7e81a into puppetlabs:main Jul 26, 2021
@bastelfreak
Copy link
Collaborator

@da-ar awesome, thanks for merging. Would it be possible to publish a new release soon?

@ekohl ekohl deleted the rubocop-gha-formatter branch July 26, 2021 09:28
@da-ar
Copy link

da-ar commented Jul 26, 2021

@da-ar awesome, thanks for merging. Would it be possible to publish a new release soon?

Sorry for the delay, I was waiting for push rights to Ruby Gems.

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

Successfully merging this pull request may close these issues.

4 participants