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

[#9760] Allow passing range as a positional argument to RangeHelp#range_with_surrounding_space #10748

Conversation

pirj
Copy link
Member

@pirj pirj commented Jun 24, 2022

Related to #9760
Prequel to #10729 and #10727


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

pirj added a commit to rubocop/rubocop-rspec that referenced this pull request Jun 24, 2022
pirj added a commit to pirj/rubocop-rails that referenced this pull request Jun 24, 2022
@bbatsov bbatsov merged commit 9e286a0 into rubocop:master Jun 25, 2022
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 25, 2022

Looks good to me. Thanks!

@pirj pirj deleted the 9760-allow-passing-range-as-a-positional-argument-in-range_help-range_with_surrounding_space branch June 25, 2022 06:38
def range_with_surrounding_space(range:, side: :both,
newlines: true, whitespace: false,
continuations: false)
NOT_GIVEN = Module.new
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious – why is NOT_GIVEN a module and not e.g. a symbol?

Copy link
Member Author

Choose a reason for hiding this comment

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

Module.new == Module.new evaluates to false. Chances of someone passing a :not_given positional argument are nearing zero, but anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks.

pirj added a commit to pirj/rubocop-rails that referenced this pull request Jun 27, 2022
pirj added a commit to pirj/rubocop-rails that referenced this pull request Jun 27, 2022
pirj added a commit to pirj/rubocop-rails that referenced this pull request Jun 27, 2022
@pirj pirj mentioned this pull request Aug 7, 2022
pirj added a commit to rubocop/rubocop-capybara that referenced this pull request Dec 29, 2022
ydah pushed a commit to rubocop/rubocop-factory_bot that referenced this pull request Apr 13, 2023
ydah pushed a commit to rubocop/rubocop-rspec_rails that referenced this pull request Mar 27, 2024
ydah pushed a commit to rubocop/rubocop-rspec_rails that referenced this pull request Mar 27, 2024
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.

None yet

3 participants