From a9359fd5707451bbbd5782a44a9c55bbda9e37f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 23 Oct 2019 22:46:21 +0200 Subject: [PATCH] Add rules related to migrations These are rules we can't apply to existing migrations, so I'm excluding migrations in the affected years from this check. However, we should probably add timestamps columns and default values in non-null columns to at least some of the tables which don't have them. --- .rubocop.yml | 6 ------ .rubocop_basic.yml | 10 ++++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index df06cf101..cc78887e9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -15,9 +15,6 @@ Performance/EndWith: Performance/StartWith: Enabled: true -Rails/CreateTableWithTimestamps: - Enabled: true - Rails/EnumUniqueness: Enabled: true @@ -39,9 +36,6 @@ Rails/HasManyOrHasOneDependent: Rails/InverseOf: Enabled: true -Rails/NotNullColumn: - Enabled: true - Rails/ReversibleMigration: Enabled: true diff --git a/.rubocop_basic.yml b/.rubocop_basic.yml index ef29ae0ef..8f28a7a2e 100644 --- a/.rubocop_basic.yml +++ b/.rubocop_basic.yml @@ -179,6 +179,11 @@ Rails/ApplicationJob: Rails/ApplicationRecord: Enabled: true +Rails/CreateTableWithTimestamps: + Enabled: true + Exclude: + - "db/migrate/201[5-8]*" + Rails/Date: Enabled: true @@ -192,6 +197,11 @@ Rails/FindBy: Rails/HttpPositionalArguments: Enabled: true +Rails/NotNullColumn: + Enabled: true + Exclude: + - "db/migrate/201[5-7]*" + Rails/OutputSafety: Enabled: true Severity: warning