From e06e37291fe928d21435bae24b392a1b3a3b770a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2020 05:33:33 +0000 Subject: [PATCH 1/2] build(deps): bump rubocop from 0.81.0 to 0.82.0 in /Library/Homebrew Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.81.0 to 0.82.0. - [Release notes](https://github.com/rubocop-hq/rubocop/releases) - [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.81.0...v0.82.0) Signed-off-by: dependabot-preview[bot] --- Library/Homebrew/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index d425f0991770b..3c0008ded2821 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -81,7 +81,7 @@ GEM rspec-support (3.9.2) rspec-wait (0.0.9) rspec (>= 3, < 4) - rubocop (0.81.0) + rubocop (0.82.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.7.0.1) From bc964282076efc9ba32cccd5b3414b849800779d Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 17 Apr 2020 10:21:10 +0100 Subject: [PATCH 2/2] rubocop.yml: enable new rules. --- Library/.rubocop.yml | 19 +++++++++++++------ Library/.rubocop_rspec.yml | 4 ++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index 216b443b0be9b..3a800ba50d43d 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -8,6 +8,19 @@ FormulaAudit: FormulaAuditStrict: Enabled: true +# enable all pending rubocops +AllCops: + NewCops: enable + +# don't allow cops to be disabled in formulae +Style/DisableCopsWithinSourceCodeDirective: + Enabled: true + Exclude: + # TODO: really long lines but hard to resolve (but would be nice to do). + - '**/Formula/libgraphqlparser.rb' + # TODO: false positive in RuboCop, see if it can be worked around/fixed. + - '**/Formula/rpm.rb' + # make our hashes consistent Layout/HashAlignment: EnforcedHashRocketStyle: table @@ -46,12 +59,6 @@ Lint/AmbiguousRegexpLiteral: Lint/ParenthesesAsGroupedExpression: Enabled: false -# not enabled by default but nice to have -Lint/RaiseException: - Enabled: true -Lint/StructNewOverride: - Enabled: true - # most metrics don't make sense to apply for formulae/taps Metrics/AbcSize: Enabled: false diff --git a/Library/.rubocop_rspec.yml b/Library/.rubocop_rspec.yml index 6699a39d4f664..e855cce1cc555 100644 --- a/Library/.rubocop_rspec.yml +++ b/Library/.rubocop_rspec.yml @@ -8,6 +8,10 @@ AllCops: Exclude: - '**/vendor/**/*' +# allow style to be disabled in non-formulae code +Style/DisableCopsWithinSourceCodeDirective: + Enabled: false + # Intentionally disabled as it doesn't fit with our code style. RSpec/AnyInstance: Enabled: false