From 1976f27963f7c5c1bb0dd8d5898a8a7b4b982631 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Tue, 29 Jun 2021 18:54:11 +0900 Subject: [PATCH] [Fix #9895] Set `CheckStrings: false` and remove `master` from `FlaggedTerms` for `Naming/InclusiveLanguage` Fixes #9895 and follow up https://github.com/rubocop/rubocop/pull/9893#issuecomment-870343243. 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. --- .rubocop.yml | 13 ------------- ...d_remove_master_for_naming_inclusive_language.md | 1 + config/default.yml | 8 +------- spec/rubocop/cop/naming/inclusive_language_spec.rb | 9 ++++++--- tasks/cut_release.rake | 2 +- 5 files changed, 9 insertions(+), 24 deletions(-) create mode 100644 changelog/change_set_check_strings_false_and_remove_master_for_naming_inclusive_language.md diff --git a/.rubocop.yml b/.rubocop.yml index 4e4e8630fad..dbbfd6e2e1a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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: diff --git a/changelog/change_set_check_strings_false_and_remove_master_for_naming_inclusive_language.md b/changelog/change_set_check_strings_false_and_remove_master_for_naming_inclusive_language.md new file mode 100644 index 00000000000..b7f9d4f7184 --- /dev/null +++ b/changelog/change_set_check_strings_false_and_remove_master_for_naming_inclusive_language.md @@ -0,0 +1 @@ +* [#9895](https://github.com/rubocop/rubocop/issues/9895): Set `CheckStrings: false` and Remove `master` from `FlaggedTerms` for `Naming/InclusiveLanguage`. ([@koic][]) diff --git a/config/default.yml b/config/default.yml index e81ea77480f..3cf7c7ea2ae 100644 --- a/config/default.yml +++ b/config/default.yml @@ -2541,7 +2541,7 @@ Naming/InclusiveLanguage: CheckIdentifiers: true CheckConstants: true CheckVariables: true - CheckStrings: true + CheckStrings: false CheckSymbols: true CheckComments: true CheckFilepaths: true @@ -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'] diff --git a/spec/rubocop/cop/naming/inclusive_language_spec.rb b/spec/rubocop/cop/naming/inclusive_language_spec.rb index 699b6c864a1..fbcc9370155 100644 --- a/spec/rubocop/cop/naming/inclusive_language_spec.rb +++ b/spec/rubocop/cop/naming/inclusive_language_spec.rb @@ -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 diff --git a/tasks/cut_release.rake b/tasks/cut_release.rake index d86c22d199d..055711edb03 100644 --- a/tasks/cut_release.rake +++ b/tasks/cut_release.rake @@ -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