Skip to content

Commit

Permalink
Enforce always style for Style/AndOr
Browse files Browse the repository at this point in the history
There is a difference in operator precedence that may catch out people
coming from other languages

eg https://mixandgo.com/learn/ruby/boolean-operator-precedence
  • Loading branch information
JoeSouthan committed Dec 4, 2023
1 parent db56d4a commit fa873b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.2.2
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

4.4.0
-----
* Enforce `always` style for [Style/AndOr](https://docs.rubocop.org/rubocop/cops_style.html#styleandor)

4.3.0
-----

Expand Down
2 changes: 1 addition & 1 deletion gc_ruboconfig.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = 'gc_ruboconfig'
spec.version = '4.3.0'
spec.version = '4.4.0'
spec.summary = "GoCardless's shared Rubocop configuration, conforming to our house style"
spec.authors = %w[GoCardless]
spec.homepage = 'https://github.com/gocardless/ruboconfig'
Expand Down
4 changes: 4 additions & 0 deletions rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -671,3 +671,7 @@ Capybara/SpecificActions: # new in 2.14
# Seems to be buggy, causes an infinite loop for `subjects` named `create`
FactoryBot/ConsistentParenthesesStyle: # new in 2.14
Enabled: false

Style/AndOr:
Enabled: true
EnforcedStyle: always

0 comments on commit fa873b2

Please sign in to comment.