Skip to content

Commit

Permalink
Merge pull request #422 from Shopify/match_with_style_guide
Browse files Browse the repository at this point in the history
Match rubocop-shopify with style guide recommendations
  • Loading branch information
Schwad authored Jul 25, 2022
2 parents b183fcb + 57446ff commit 9655ee8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -723,3 +723,8 @@ Style/WordArray:

Style/YodaCondition:
Enabled: false

Style/ClassMethodsDefinitions:
EnforcedStyle: self_class
Enabled: true

4 changes: 2 additions & 2 deletions test/fixtures/full_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2368,9 +2368,9 @@ Style/ClassMethodsDefinitions:
Description: Enforces using `def self.method_name` or `class << self` to define
class methods.
StyleGuide: "#def-self-class-methods"
Enabled: false
Enabled: true
VersionAdded: '0.89'
EnforcedStyle: def_self
EnforcedStyle: self_class
SupportedStyles:
- def_self
- self_class
Expand Down
6 changes: 4 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
require "pry-byebug"

module Warning
def self.warn(message)
raise message.to_s
class << self
def warn(message)
raise message.to_s
end
end
end
Warning[:deprecated] = true

0 comments on commit 9655ee8

Please sign in to comment.