Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/sort-cops
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'yaml'
require "yaml"

def extract_cop_entries(content)
# Extract all cop configurations (entries that start with a department name)
Expand All @@ -19,7 +19,7 @@ def extract_cop_entries(content)
end

# Start new cop
current_cop = line.split(':').first
current_cop = line.split(":").first
current_config = [line]
elsif current_cop
current_config << line
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/minimum_rubocop.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ eval_gemfile "../Gemfile"
# This extracts the minimum rubocop version from our gemspec,
# allowing us to ensure that it remains compatible.

supported_requirement_types = ['>=', '~>']
supported_requirement_types = [">=", "~>"]
supported_requirements, unsupported_requirements = Gem::Specification
.load("rubocop-shopify.gemspec")
.dependencies.find { |d| d.name == "rubocop" }
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/no_return_in_memoization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module Lint
# end
# end
class NoReturnInMemoization < ::RuboCop::Cop::Base
MSG = 'Do not `return` in `begin..end` blocks in instance variable assignment contexts.'
MSG = "Do not `return` in `begin..end` blocks in instance variable assignment contexts."

def on_or_asgn(node)
node.each_node(:kwbegin) do |kwbegin_node|
Expand Down
92 changes: 11 additions & 81 deletions rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -615,14 +615,14 @@ Style/Alias:
EnforcedStyle: prefer_alias_method

Style/AmbiguousEndlessMethodDefinition:
Enabled: false

Style/AndOr:
Enabled: false
Enabled: true

Style/ArgumentsForwarding:
Enabled: false

Style/ArrayCoercion:
Enabled: true

Style/ArrayIntersect:
Enabled: false

Expand All @@ -634,24 +634,15 @@ Style/ArrayIntersectWithSingleElement:
Style/ArrayJoin:
Enabled: false

Style/Attr:
Enabled: false

Style/BarePercentLiterals:
Enabled: false

Style/BeginBlock:
Enabled: false

Style/BisectedAttrAccessor:
Enabled: false

Style/BitwisePredicate:
Enabled: false

Style/BlockComments:
Enabled: false

Style/BlockDelimiters:
Enabled: false

Expand All @@ -663,27 +654,16 @@ Style/CaseEquality:
Style/CaseLikeIf:
Enabled: false

Style/CharacterLiteral:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false

Style/ClassCheck:
Enabled: false

Style/ClassEqualityComparison:
Enabled: false

Style/ClassMethods:
Enabled: false

Style/ClassMethodsDefinitions:
Enabled: true
EnforcedStyle: self_class

Style/ClassVars:
Enabled: false

Style/CollectionCompact:
Enabled: false

Expand All @@ -692,14 +672,8 @@ Style/CollectionQuerying:
Enabled: true
<% end %>

Style/ColonMethodCall:
Enabled: false

Style/ColonMethodDefinition:
Enabled: false

Style/CombinableDefined:
Enabled: false
Enabled: true

Style/CombinableLoops:
Enabled: false
Expand Down Expand Up @@ -731,11 +705,11 @@ Style/ConditionalAssignment:
Style/DataInheritance:
Enabled: false

Style/DefWithParentheses:
Enabled: false
Style/DateTime:
Enabled: true

Style/DigChain:
Enabled: false
Enabled: true

Style/Dir:
Enabled: false
Expand Down Expand Up @@ -795,7 +769,7 @@ Style/EndBlock:
Enabled: false

Style/EndlessMethod:
Enabled: false
Enabled: true

Style/EnvHome:
Enabled: false
Expand Down Expand Up @@ -858,9 +832,6 @@ Style/FrozenStringLiteralComment:
Style/GlobalStdStream:
Enabled: false

Style/GlobalVars:
Enabled: false

Style/GuardClause:
Enabled: false

Expand All @@ -887,9 +858,6 @@ Style/HashLikeCase:
Style/HashSlice:
Enabled: false

Style/HashSyntax:
Enabled: false

Style/HashTransformKeys:
Enabled: false

Expand Down Expand Up @@ -947,7 +915,7 @@ Style/LineEndConcatenation:
Enabled: false

Style/MagicCommentFormat:
Enabled: false
Enabled: true
ValueCapitalization: lowercase

Style/MapCompactWithConditionalBlock:
Expand Down Expand Up @@ -976,9 +944,6 @@ Style/MethodCallWithArgsParentheses:
Style/MethodCallWithoutArgsParentheses:
Enabled: false

Style/MethodDefParentheses:
Enabled: false

Style/MinMax:
Enabled: false

Expand Down Expand Up @@ -1140,9 +1105,6 @@ Style/RedundantArrayFlatten:
Style/RedundantAssignment:
Enabled: false

Style/RedundantBegin:
Enabled: false

Style/RedundantCapitalW:
Enabled: false

Expand Down Expand Up @@ -1215,12 +1177,6 @@ Style/RedundantRegexpConstructor:
Style/RedundantRegexpEscape:
Enabled: false

Style/RedundantReturn:
Enabled: false

Style/RedundantSelf:
Enabled: false

Style/RedundantSelfAssignment:
Enabled: false

Expand Down Expand Up @@ -1264,9 +1220,6 @@ Style/SelectByRegexp:
Style/SelfAssignment:
Enabled: false

Style/Semicolon:
Enabled: false

Style/SendWithLiteralMethodName:
Enabled: false

Expand Down Expand Up @@ -1305,11 +1258,9 @@ Style/StringConcatenation:

Style/StringLiterals:
Enabled: false
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
Enabled: false
EnforcedStyle: double_quotes

Style/Strip:
Enabled: false
Expand All @@ -1330,24 +1281,12 @@ Style/SymbolArray:
Enabled: false
EnforcedStyle: brackets

Style/SymbolLiteral:
Enabled: false

Style/SymbolProc:
Enabled: false

Style/TernaryParentheses:
Enabled: false

Style/TrailingBodyOnClass:
Enabled: false

Style/TrailingBodyOnMethodDefinition:
Enabled: false

Style/TrailingBodyOnModule:
Enabled: false

Style/TrailingCommaInArguments:
Enabled: false
EnforcedStyleForMultiline: comma
Expand All @@ -1360,24 +1299,15 @@ Style/TrailingCommaInHashLiteral:
Enabled: false
EnforcedStyleForMultiline: consistent_comma

Style/TrailingMethodEndStatement:
Enabled: false

Style/TrailingUnderscoreVariable:
Enabled: false

Style/TrivialAccessors:
Enabled: false

Style/UnlessElse:
Enabled: false

Style/UnpackFirst:
Enabled: false

Style/VariableInterpolation:
Enabled: false

Style/WhenThen:
Enabled: false

Expand Down
6 changes: 3 additions & 3 deletions test/config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ def test_no_cops_are_configured_as_pending

def test_config_does_not_check_for_rubocop_versions_below_minimum_version
rubocop_version_requirement = Gem
.loaded_specs.fetch('rubocop-shopify')
.dependencies.find { _1.name == 'rubocop' }
.loaded_specs.fetch("rubocop-shopify")
.dependencies.find { _1.name == "rubocop" }
.requirement

# RuboCop version checks are done in ERB, so we need to read the raw file
redundant_rubocop_version_checks = File.read('rubocop.yml').each_line.with_index.filter_map do |line, index|
redundant_rubocop_version_checks = File.read("rubocop.yml").each_line.with_index.filter_map do |line, index|
match = line.match(/<% if rubocop_version >= "(?<version>.*)" %>/)
next unless match

Expand Down
Loading