Skip to content

Commit

Permalink
[Fix rubocop#9895] Set CheckStrings: false and remove master from…
Browse files Browse the repository at this point in the history
… `FlaggedTerms` for `Naming/InclusiveLanguage`

Fixes rubocop#9895 and follow up rubocop#9893 (comment).

This PR sets `CheckStrings: false` and removes `master` from `FlaggedTerms` for `Naming/InclusiveLanguage`
because it has an unexpectedly impact for many users who give feedback.
  • Loading branch information
koic committed Jun 29, 2021
1 parent ba3e33e commit 1976f27
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 24 deletions.
13 changes: 0 additions & 13 deletions .rubocop.yml
Expand Up @@ -100,19 +100,6 @@ Metrics/ModuleLength:
Naming/InclusiveLanguage:
Exclude:
- lib/rubocop/cop/naming/inclusive_language.rb
- spec/rubocop/cop/naming/inclusive_language_spec.rb
FlaggedTerms:
whitelist:
Suggestions:
- allowlist
blacklist:
Suggestions:
- denylist
master:
AllowedRegex:
- 'blob/master/'
- 'master \(unreleased\)'
- !ruby/regexp "/ENV\\['RUBOCOP_VERSION'\\] == 'master'/"

RSpec/FilePath:
Exclude:
Expand Down
@@ -0,0 +1 @@
* [#9895](https://github.com/rubocop/rubocop/issues/9895): Set `CheckStrings: false` and Remove `master` from `FlaggedTerms` for `Naming/InclusiveLanguage`. ([@koic][])
8 changes: 1 addition & 7 deletions config/default.yml
Expand Up @@ -2541,7 +2541,7 @@ Naming/InclusiveLanguage:
CheckIdentifiers: true
CheckConstants: true
CheckVariables: true
CheckStrings: true
CheckStrings: false
CheckSymbols: true
CheckComments: true
CheckFilepaths: true
Expand All @@ -2556,12 +2556,6 @@ Naming/InclusiveLanguage:
Suggestions:
- denylist
- block
master:
Suggestions: ['main', 'primary', 'leader']
AllowedRegex:
- 'Master of None'
- 'Master Boot Record'
- 'Mastercard'
slave:
Suggestions: ['replica', 'secondary', 'follower']

Expand Down
9 changes: 6 additions & 3 deletions spec/rubocop/cop/naming/inclusive_language_spec.rb
Expand Up @@ -136,9 +136,12 @@ class Nodewhitelist

context 'flagged term with three or more suggestions' do
let(:cop_config) do
{ 'FlaggedTerms' => {
'master' => { 'Suggestions' => %w[main primary leader] }
} }
{
'CheckStrings' => true,
'FlaggedTerms' => {
'master' => { 'Suggestions' => %w[main primary leader] }
}
}
end

it 'includes all suggestions in the message' do
Expand Down
2 changes: 1 addition & 1 deletion tasks/cut_release.rake
Expand Up @@ -40,7 +40,7 @@ namespace :cut_release do
def update_docs(old_version, new_version)
update_file('docs/antora.yml') do |antora_metadata|
antora_metadata.sub(
"version: 'master'", # rubocop:disable Naming/InclusiveLanguage
"version: 'master'",
"version: '#{version_sans_patch(new_version)}'"
)
end
Expand Down

0 comments on commit 1976f27

Please sign in to comment.