You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuboCop::Cop::Naming::InclusiveLanguage flags symbols that happen to contain the string "slave" as offences, even when they are contained in composited words. For example "SLAVersion" or "TeslaVehicle" are seen as offences, but "sla_version" or "tesla_vehicle" are not. I think these 'false positives' point to a bug.
Expected behavior
The inclusive language cop should mark "slave", "Slave" and "SLAVE" as offences, but not "SLAVe" or "slaVe" or other casings that are the result of compositing words. I would expect the casing of characters to have an influence on the determination of an offence.
Actual behavior
Symbols containing "SLAVe" or "slaVe" are marked as offences by the inclusive language cop, with the following output:
rubocop -A --debug /Users/xxxx/app/models/concerns/xxxx.rb
For /Users/xxxx: configuration from /Users/xxxx/.rubocop.yml
configuration from /Users/xxxx/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rubocop-rails-2.11.3/config/default.yml
configuration from /Users/xxxx/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rubocop-rails-2.11.3/config/default.yml
Default configuration from /Users/xxxx/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rubocop-1.18.4/config/default.yml
Inheriting configuration from /Users/xxxx/.rubocop_todo.yml
.rubocop.yml: Lint/UselessAssignment:Exclude overrides the same parameter in .rubocop_todo.yml
.rubocop.yml: Metrics/CyclomaticComplexity:Max overrides the same parameter in .rubocop_todo.yml
.rubocop.yml: Metrics/PerceivedComplexity:Max overrides the same parameter in .rubocop_todo.yml
Inspecting 1 file
Scanning /Users/xxxx/app/models/concerns/xxxx.rb
Loading cache from /Users/xxxx/.cache/rubocop_cache/f5e32fae37ef606b02bd1b4d287d15320b11827e/32a823ae5c5ceea585bb78727fd983b60ae7a358/7d463336a8c621971967fd1aa6370fda630363bf
C
Offenses:
app/models/concerns/xxxx.rb:52:10: C: Naming/InclusiveLanguage: Consider replacing problematic term 'slaVe' with 'replica', 'secondary', or 'follower'.
class VizslaVet; end
^^^^^
app/models/concerns/xxxx.rb:54:9: C: Naming/InclusiveLanguage: Consider replacing problematic term 'slaVe' with 'replica', 'secondary', or 'follower'.
class TeslaVehicle; end
^^^^^
app/models/concerns/xxxx.rb:56:7: C: Naming/InclusiveLanguage: Consider replacing problematic term 'SLAVe' with 'replica', 'secondary', or 'follower'.
class SLAVersion; end
^^^^^
1 file inspected, 3 offenses detected
Finished in 0.8737279999913881 seconds
Process finished with exit code 1
Steps to reproduce the problem
Put any one of these classes in a file inspected by rubocop with the inclusive language cop enabled:
class SLAVersion; end
class TeslaVehicle; end
class VizslaVet; end
RuboCop version
$ [bundle exec] rubocop -V -A /Users/****.rb
1.18.4 (using Parser 3.0.2.0, rubocop-ast 1.8.0, running on ruby 2.7.3 arm64-darwin20)
- rubocop-rails 2.11.3
Process finished with exit code 0
The text was updated successfully, but these errors were encountered:
RuboCop::Cop::Naming::InclusiveLanguage
flags symbols that happen to contain the string "slave" as offences, even when they are contained in composited words. For example "SLAVersion" or "TeslaVehicle" are seen as offences, but "sla_version" or "tesla_vehicle" are not. I think these 'false positives' point to a bug.Expected behavior
The inclusive language cop should mark "slave", "Slave" and "SLAVE" as offences, but not "SLAVe" or "slaVe" or other casings that are the result of compositing words. I would expect the casing of characters to have an influence on the determination of an offence.
Actual behavior
Symbols containing "SLAVe" or "slaVe" are marked as offences by the inclusive language cop, with the following output:
Steps to reproduce the problem
Put any one of these classes in a file inspected by rubocop with the inclusive language cop enabled:
class SLAVersion; end
class TeslaVehicle; end
class VizslaVet; end
RuboCop version
The text was updated successfully, but these errors were encountered: