From d2edc4d1922356eb8546403457dd52592f06c5c7 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sat, 4 Mar 2023 16:54:13 +0000 Subject: [PATCH] rubocop: Intentionally disable `RSpec/{DescribeClass,StubbedMock}` - These had a lot of offenses that were marked as "try to enable". - A lot of the "describe class" ones were for tests for cmds or dev-cmds, `brew typecheck` or `brew --env`, and the cop would only pass if I changed these "describe"s to `BrewTypecheck` or `Brew__Env` which seemed unhelpful. - The usefulness of the stubbed mocks cop is [disputed](https://github.com/rubocop/rubocop-rspec/issues/ 1271), and fixing the offenses (not autocorrectable) would involve us doing a fair number of changes since changing `expect` to `allow` would then force us to make each of the affected tests have `expect` assertions at the end, where they sometimes don't currently. --- Library/.rubocop.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index dd3acb264a..81151e3260 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -274,8 +274,12 @@ Rails/ToFormattedS: # Intentionally disabled as it doesn't fit with our code style. RSpec/AnyInstance: Enabled: false +RSpec/DescribeClass: + Enabled: false RSpec/FilePath: Enabled: false +RSpec/StubbedMock: + Enabled: false RSpec/SubjectStub: Enabled: false @@ -283,12 +287,6 @@ RSpec/SubjectStub: RSpec/MessageSpies: EnforcedStyle: receive -# TODO: try to enable these -RSpec/DescribeClass: - Enabled: false -RSpec/StubbedMock: - Enabled: false - # These were ever-growing numbers, not useful. RSpec/ExampleLength: Enabled: false