From e5a0a2594c3ae9fa3fd78895ba2c85fe39ff5d4d Mon Sep 17 00:00:00 2001 From: Miha Rekar Date: Mon, 9 Nov 2020 10:43:36 +0100 Subject: [PATCH] Ignore schema on RuboCop Needs "--force-exclusion" to respect excluded files as per https://github.com/rubocop-hq/rubocop/issues/893 --- .rubocop.yml | 21 ++++++++++++--------- .rubocop_todo.yml | 15 --------------- package.json | 2 +- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e85bea5a4b..1e2f9924e7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,8 @@ require: AllCops: NewCops: enable + Exclude: + - 'db/schema.rb' Layout/SpaceInsideHashLiteralBraces: Enabled: true @@ -19,33 +21,34 @@ Layout/DotPosition: Enabled: true EnforcedStyle: trailing -Style/RaiseArgs: +Metrics/BlockLength: Enabled: false -Style/NumericLiterals: +Metrics/ClassLength: Enabled: false -Style/Send: - Enabled: true +Metrics/MethodLength: + Enabled: false -Metrics/ClassLength: +Style/RaiseArgs: Enabled: false -Metrics/MethodLength: +Style/NumericLiterals: Enabled: false -Style/AndOr: +Style/Send: Enabled: true - EnforcedStyle: always -Style/Send: +Style/AndOr: Enabled: true + EnforcedStyle: always Rails/DynamicFindBy: Enabled: false Rails/SquishedSQLHeredocs: Enabled: false + # Let's discuss this one # I'd like to go double quotes everywhere, but am open to discussion # Style/StringLiterals: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9a570eb1b4..4c4a1b9400 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -83,14 +83,6 @@ Layout/EmptyLinesAroundAccessModifier: Exclude: - 'app/policies/guild/post_policy.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: empty_lines, no_empty_lines -Layout/EmptyLinesAroundBlockBody: - Exclude: - - 'db/schema.rb' - # Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. @@ -276,13 +268,6 @@ Lint/UselessMethodDefinition: Metrics/AbcSize: Max: 79 -# Offense count: 202 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods. -# ExcludedMethods: refine -Metrics/BlockLength: - Max: 790 - - # Offense count: 4 # Configuration parameters: IgnoredMethods. Metrics/CyclomaticComplexity: diff --git a/package.json b/package.json index 44932e9348..c49756b319 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ "build-storybook": "build-storybook -c donut/.storybook" }, "lint-staged": { - "*.rb": "bundle exec rubocop", + "*.rb": "bundle exec rubocop --force-exclusion", "*.js": [ "eslint --cache --fix", "prettier"