aboutsummaryrefslogtreecommitdiffstats
path: root/.rubocop.yml
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2018-04-17 08:37:35 -0400
committerDaniel Colson <danieljamescolson@gmail.com>2018-04-19 08:11:28 -0400
commit087e0ccb72e7a1491701dd1d1d49746f745d9d68 (patch)
treeda79375760e74db0bc466695cce13689666ef430 /.rubocop.yml
parentef2af628a9ec1cc4e7b6997a021dd3f85cfe4665 (diff)
downloadrails-087e0ccb72e7a1491701dd1d1d49746f745d9d68.tar.gz
rails-087e0ccb72e7a1491701dd1d1d49746f745d9d68.tar.bz2
rails-087e0ccb72e7a1491701dd1d1d49746f745d9d68.zip
Add RuboCop for `assert_not` over `assert !`
We added `assert_not` in f75addd "to replace warty 'assert !foo'". fa8d35b agrees that it is warty, and so do I. This custom Rubocop rule turns the wart into a violation. As with my last custom cop, https://github.com/rails/rails/pull/32441, I want to make sure this looks right on code climate before pushing another commit to autocorrect everything. @toshimaru I just noticed https://github.com/toshimaru/rubocop-rails/pull/26 Is there a better way to add these custom cops, or were you saying we shouldn't have custom cops at all?
Diffstat (limited to '.rubocop.yml')
-rw-r--r--.rubocop.yml5
1 files changed, 5 insertions, 0 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index eb410376fe..9d1ec47aee 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -15,6 +15,11 @@ CustomCops/RefuteNot:
Include:
- '**/*_test.rb'
+# Prefer assert_not over assert !
+CustomCops/AssertNot:
+ Include:
+ - '**/*_test.rb'
+
# Prefer &&/|| over and/or.
Style/AndOr:
Enabled: true