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

(CAT-1488) - Fix rubocop warnings #157

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

gavindidrichsen
Copy link

@gavindidrichsen gavindidrichsen commented Oct 2, 2023

Summary

This PR fixes CI by excluding the soon-to-be deprecated Rspec/FilePath.

Additional Context

During investigation and after running bundle exec rubocop --format github 2 simultaneous warnings were observed Rspec/FilePath (deprecated) and Rspec/SpecFilePathFormat:

::error file=spec/unit/puppet_lint/puppet-lint_spec.rb,line=1,col=1::RSpec/SpecFilePathFormat: Spec path should end with `puppet_lint*_spec.rb`. (https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SpecFilePathFormat)
::error file=spec/unit/puppet_lint/puppet-lint_spec.rb,line=5,col=1::RSpec/FilePath: Spec path should end with `puppet_lint*_spec.rb`. (https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath)
➜

The warning seem to be expecting a puppet_lint directory rather than the current puppet-lint one. After excluding the deprecated Rspec/FilePath cop, then the rubocop warnings cleared.

Since this cop is going to be deprecated in the next major release of rubocop >=3.0.0 according to the documentation, I've:

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@gavindidrichsen gavindidrichsen changed the title Cat 1488 updating rubocop warnings (CAT-1488) - Fix rubocop warnings Oct 2, 2023
@gavindidrichsen gavindidrichsen force-pushed the cat_1488_updating_rubocop_warnings branch from cce39c5 to 4ea249d Compare October 2, 2023 16:02
@gavindidrichsen gavindidrichsen marked this pull request as ready for review October 2, 2023 16:18
Copy link

@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.

Can confirm #155 also fails on this cop.

.rubocop_todo.yml Outdated Show resolved Hide resolved
@gavindidrichsen gavindidrichsen marked this pull request as draft October 3, 2023 11:41
@gavindidrichsen gavindidrichsen force-pushed the cat_1488_updating_rubocop_warnings branch 2 times, most recently from 24450f3 to 493e2f7 Compare October 3, 2023 13:37
@gavindidrichsen gavindidrichsen force-pushed the cat_1488_updating_rubocop_warnings branch from 493e2f7 to e3a7006 Compare October 3, 2023 13:46
Why?  ``Rspec/FilePath`` is going to be deprecated in the next major release of rubocop >=3.0.0: see <https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath>.  As the new cops are already present, e.g., Rspec/SpecFilePathPathFormat, then disabling this in preparation.  NOTE: I've added this to the bottom of ``rubocop_baseline.yml`` to highlight that it is deprecated.

Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
@gavindidrichsen gavindidrichsen force-pushed the cat_1488_updating_rubocop_warnings branch from c074506 to 284dc12 Compare October 3, 2023 13:48
@gavindidrichsen gavindidrichsen marked this pull request as ready for review October 3, 2023 14:03
Copy link

@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.

Makes sense to me. I'd stick to wrapping the body of the commit message per https://cbea.ms/git-commit/#wrap-72 but that may be for others to decide on.

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.

3 participants