From edef2bb16a19b0168b38597f4b01bdbba9fed9bc Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Sun, 23 Aug 2020 13:05:22 +0300 Subject: [PATCH] fixup! Update cop department namespacing upgrade docs --- .../modules/ROOT/pages/upgrade_to_version_2.adoc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/modules/ROOT/pages/upgrade_to_version_2.adoc b/docs/modules/ROOT/pages/upgrade_to_version_2.adoc index 81c58b7da..93a3a640a 100644 --- a/docs/modules/ROOT/pages/upgrade_to_version_2.adoc +++ b/docs/modules/ROOT/pages/upgrade_to_version_2.adoc @@ -7,7 +7,7 @@ In version 2.x: - `RSpec/InvalidPredicateMatcher` cop is removed - `CustomIncludeMethods` configuration option for `RSpec/EmptyExampleGroup` is removed - - cop departments are nested + - cop departments are nested for cops with a department that doesn't match the extension name (`Capybara`, `FactoryBot`, `Rails`) [discrete] === Adjust the configuration of `RSpec/EmptyExampleGroup` @@ -33,33 +33,35 @@ AllCops: === Add a top-level `RSpec` department RuboCop extensions had cops with clashing names and departments, e.g. both `rspec-rails` and `rubocop-rspec` had `Rails::HttpStatus` cops. -Also, in some circumstances RuboCop was complaining that some cops have wrong departments specified in the config file, e.g. `RSpec::FilePath` and `Rails::FilePath`, `RSpec/VariableName` and `Naming/VariableName`. To avoid issues, e.g. inability to disable just one of the cops, each extension now has its own uber-department. Expectedly, RuboCop RSpec's uber-department name is `RSpec`. +Changes are only applied to cops that don't already have the department set to `RSpec`, i.e. `Capybara`, `FactoryBot` and `Rails`. [source,yaml] ---- # .rubocop.yml # Before -RSpec/EmptyExampleGroup: - Enabled: false - Capybara/CurrentPathExpectation: Enabled: false FactoryBot/AttributeDefinedStatically: Enabled: false -# After -RSpec/RSpec/EmptyExampleGroup: +# remains the same +RSpec/EmptyExampleGroup: Enabled: false +# After RSpec/Capybara/CurrentPathExpectation: Enabled: false RSpec/FactoryBot/AttributeDefinedStatically: Enabled: false + +# remains the same +RSpec/EmptyExampleGroup: + Enabled: false ---- https://github.com/rubocop-hq/rubocop/pull/8490[Learn more about this change].