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

Correct a InternalAffairs/NodeFirstOrLastArgument #83

Merged
merged 1 commit into from
Nov 21, 2023
Merged

Conversation

ydah
Copy link
Member

@ydah ydah commented Nov 21, 2023

❯ bundle exec rubocop -A
Inspecting 40 files
.................C......................

Offenses:

lib/rubocop/cop/capybara/specific_finders.rb:79:30: C: [Corrected] InternalAffairs/NodeFirstOrLastArgument: Use #first_argument instead of #arguments[0].
range_between(node.arguments[0].source_range.end_pos,
^^^^^^^^^^^^

40 files inspected, 1 offense detected, 1 offense corrected


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with main (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).

If you have created a new cop:

  • Added the new cop to config/default.yml.
  • The cop is configured as Enabled: pending in config/default.yml.
  • The cop documents examples of good and bad code.
  • The tests assert both that bad code is reported and that good code is not reported.
  • Set VersionAdded: "<<next>>" in default/config.yml.

If you have modified an existing cop's configuration options:

  • Set VersionChanged: "<<next>>" in config/default.yml.

❯ bundle exec rubocop -A
Inspecting 40 files
.................C......................

Offenses:

lib/rubocop/cop/capybara/specific_finders.rb:79:30: C: [Corrected] InternalAffairs/NodeFirstOrLastArgument: Use #first_argument instead of #arguments[0].
          range_between(node.arguments[0].source_range.end_pos,
                             ^^^^^^^^^^^^

40 files inspected, 1 offense detected, 1 offense corrected
@pirj pirj merged commit 2c83129 into main Nov 21, 2023
23 checks passed
@pirj pirj deleted the fix-offense branch November 21, 2023 12:02
@pirj
Copy link
Member

pirj commented Nov 21, 2023

Thank you!

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