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

Fix .rubocop_todo.yml #1263

Merged
merged 2 commits into from
Apr 21, 2022
Merged

Fix .rubocop_todo.yml #1263

merged 2 commits into from
Apr 21, 2022

Conversation

pirj
Copy link
Member

@pirj pirj commented Apr 20, 2022

Take a shortcut compared to #982

My apologies it took me nearly two years 😄


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • [-] Added tests.
  • [-] Updated documentation.
  • [-] Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@pirj pirj self-assigned this Apr 20, 2022
Max: 106

RSpec/ExampleLength:
Exclude:
Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't seem to cause any trouble anymore

@@ -129,17 +128,13 @@ def message(offense)
end

def scope_change?(node)
scope_changing_syntax?(node) ||
Copy link
Member Author

Choose a reason for hiding this comment

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

Styling

@@ -152,6 +147,7 @@ def offensive?(node)

def offensive_described_class?(node)
return unless node.const_type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Styling. I found it hard to understand what guard statement this comment relates to.

# rubocop:disable InternalAffairs/NodeDestructuring
namespace, name = *node
# rubocop:enable InternalAffairs/NodeDestructuring
namespace, name = *node # rubocop:disable InternalAffairs/NodeDestructuring
Copy link
Member Author

Choose a reason for hiding this comment

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

Styling.

@pirj pirj requested review from bquorning and Darhazer April 20, 2022 21:33
Copy link
Collaborator

@bquorning bquorning left a comment

Choose a reason for hiding this comment

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

I had completely forgotten about #982. I still think it makes sense to extract the logic instead of just “inline methods and remove line breaks” as this PR seems to do. Or to follow @Darhazer’s advice and look towards rubocop-ast (and perhaps move some logic from our repository to their repository).

lib/rubocop/cop/rspec/described_class.rb Outdated Show resolved Hide resolved
@pirj
Copy link
Member Author

pirj commented Apr 21, 2022

I still think it makes sense to extract the logic

Makes total sense. Especially since the cop is on alerting 100% usage of allowed lines. I can handle this refactoring separately in #982.

@pirj pirj force-pushed the fix-metrics-classlength-2 branch from 4cdd2b2 to 648e5ff Compare April 21, 2022 15:17
@pirj pirj merged commit 2f8ec8a into master Apr 21, 2022
@pirj pirj deleted the fix-metrics-classlength-2 branch April 21, 2022 15:18
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.

3 participants