Skip to content

Conversation

@rafaelfranca
Copy link
Member

@rafaelfranca rafaelfranca commented Oct 30, 2025

@rafaelfranca rafaelfranca requested a review from a team as a code owner October 30, 2025 21:18
@github-actions github-actions bot added the config change Changes the Rubocop config by enabling, disabling, or reconfiguring one or many cops label Oct 30, 2025
@rafaelfranca rafaelfranca force-pushed the rm-naming-department branch 2 times, most recently from 106f40b to ce85b4b Compare October 30, 2025 21:51
VersionAdded: '0.53'
VersionChanged: '0.77'
MinNameLength: 3
MinNameLength: 1
Copy link
Member

@gmcgibbon gmcgibbon Oct 30, 2025

Choose a reason for hiding this comment

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

What's the rationale for this? One would encourage names like x and y, right?

Copy link
Member

Choose a reason for hiding this comment

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

I can see how sometimes that might be needed though:

class Point
  def initialize(x, y)
    @x = x
    @y = y
  end
end

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this cop will little value with MinNameLength: 1. What if, instead, we add to AllowedNames?

AllowedNames:
  # (merged with default list, including `id`, `db`, etc.)
  - a
  - b
  - c
  - x
  - y
  - z

Another option is for the cop to simply be disabled when it is a bad fit

Exclude:
  - /path/to/point.rb
  - /path/to/geometry/**

Copy link
Member Author

Choose a reason for hiding this comment

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

We should not care about the size. What we are trying to get here is camelCase arguments that I found when enabling this cop.

Copy link
Contributor

@sambostock sambostock left a comment

Choose a reason for hiding this comment

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

Couple thoughts, but no blockers.

Comment on lines -2313 to -2314
AllowedPatterns:
- "\\Atest_"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this? Don't we want to permit descriptive test names?

def test_rejects_HTTP_requests  = ...
def test_accepts_HTTPS_requests = ...

Not every project uses ActiveSupport::TestCase.

Copy link
Member Author

Choose a reason for hiding this comment

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

there is no reason to use acronyms in the test name. Just write everything downcased.

@rafaelfranca rafaelfranca merged commit f801c39 into main Nov 4, 2025
20 checks passed
@rafaelfranca rafaelfranca deleted the rm-naming-department branch November 4, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config change Changes the Rubocop config by enabling, disabling, or reconfiguring one or many cops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants