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

RuboCop - enable new cops, address new issues #1220

Merged
merged 15 commits into from
Jun 28, 2022
Merged

RuboCop - enable new cops, address new issues #1220

merged 15 commits into from
Jun 28, 2022

Conversation

fallwith
Copy link
Contributor

  • default to enabling new cops as they are released
  • address all current issues with cops we didn't previously have enabled
  • disable certain cops and place TODO reminders alongside them for
    future enabling

- default to enabling new cops as they are released
- address all current issues with cops we didn't previously have enabled
- disable certain cops and place TODO reminders alongside them for
  future enabling
kaylareopelle
kaylareopelle previously approved these changes Jun 24, 2022
Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

Awesome proactivity! Thanks for taking this on, James!

Also, branch ref? https://robocop.fandom.com/wiki/Clara_Murphy

infinite_tracing/lib/infinite_tracing/transformer.rb Outdated Show resolved Hide resolved
@@ -13,4 +13,5 @@ Gem::Specification.new do |spec|
f.match(%r{^(test|spec|features)/})
end
spec.require_paths = ["lib"]
spec.metadata['rubygems_mfa_required'] = 'true'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious -- why add this here?

Also, have you done any absorbing of this gem? I'm somewhat skeptical about its contemporary relevance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a new cop, Gemspec/RequireMFA, that insists on this line being present in gemspec files. I don't know if we're ready to start using that declaration yet for our 2 main gemspec files, so I have disabled the cop for now and left those files untouched. But for this file that is basically a fixture file, I figured it was ok to leave the rubocop -a driven addition.

@kaylareopelle kaylareopelle self-requested a review June 24, 2022 15:23
@kaylareopelle
Copy link
Contributor

Whoops, approved and then noticed the failures. My bad.

@fallwith
Copy link
Contributor Author

Also, branch ref? https://robocop.fandom.com/wiki/Clara_Murphy

Yep! I was referring to RoboCop's last name, shared with his wife Clara.

`Gemspec/DateAssignment` -> `Gemspec/DeprecatedAttributeAssignment`
bring compliance with the latest RuboCop v1.31.0 cops and defaults
update the metric data test to reflect the change made to
MetricData.hash
@@ -33,7 +33,7 @@ def metric_spec= new_spec
end

def hash
metric_spec.hash ^ stats.hash
[metric_spec, stats].hash
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -11,8 +11,8 @@

executes do
::NewRelic::Agent.logger.info 'Installing Rails Sunspot instrumentation'
deprecation_msg = 'The instrumentation for Sunspot is deprecated.' \
' It will be removed in version 9.0.0.' \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess is that this trailing slash would cause issues should it ever get executed. Perhaps we've broken support for Sunspot earlier than expected?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch! I guess that makes it two public-facing changes this release 😉

prevent rack-test 2+ from being installed with the Rails multiverse
suite for now
`Gemspec/DateAssignment` -> `Gemspec/DeprecatedAttributeAssignment`
for JRuby's sake, leave ENV['HOME'] as-is and don't replace it with
Dir.home
use libcurl4-openssl-dev to fetch libcurl
to make the local machine aware of which packages exist before
attempting to fetch them, run `apt-get update` first.

this will hopefully address the issue with Azure aggressively keeping
only the very latest versions of some packages (libcurl is one that's
known so far).
Now that the libcurl issue has been traced to `apt-get update` needing
to be ran, go back to using the `libcurl4-nss-dev` package
CI: be sure to run `apt-get update` before `apt-get install`
Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

Thanks for keeping us up to date with Rubocop and resolving the CI issues. I have a few small suggestions. Let me know when you'd like me to take another look.

.rubocop.yml Outdated Show resolved Hide resolved
.rubocop.yml Outdated Show resolved Hide resolved
@@ -11,8 +11,8 @@

executes do
::NewRelic::Agent.logger.info 'Installing Rails Sunspot instrumentation'
deprecation_msg = 'The instrumentation for Sunspot is deprecated.' \
' It will be removed in version 9.0.0.' \
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch! I guess that makes it two public-facing changes this release 😉

test/multiverse/suites/rails/Envfile Outdated Show resolved Hide resolved
fallwith and others added 2 commits June 28, 2022 15:24
'enalbe' -> 'enable'

Co-authored-by: Kayla Reopelle (she/her) <87386821+kaylareopelle@users.noreply.github.com>
- disable `Style/MapToHash` with a reminder to enable it in a Ruby 2.6+
  world
- update new TODO comments with a `UNIT TESTS` label for easier
  categorization
kaylareopelle
kaylareopelle previously approved these changes Jun 28, 2022
Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

🎉

@fallwith fallwith merged commit 0fa75de into dev Jun 28, 2022
@fallwith fallwith deleted the murphy branch June 28, 2022 23:12
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.

2 participants