Browse Source

Merge pull request #782 from Shopify/re-enable-rubocop

Re-enabling rubocop checks
Paulo Margarido 4 years ago
parent
commit
7a1db825eb
4 changed files with 533 additions and 45 deletions
  1. 35 40
      .rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml
  2. 1 3
      .rubocop.yml
  3. 492 0
      .rubocop_todo.yml
  4. 5 2
      Rakefile

+ 35 - 40
.rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml

@@ -20,7 +20,7 @@ Style/Alias:
   - prefer_alias
   - prefer_alias_method
 
-Layout/AlignHash:
+Layout/HashAlignment:
   EnforcedHashRocketStyle: key
   EnforcedColonStyle: key
   EnforcedLastArgumentHashStyle: ignore_implicit
@@ -30,7 +30,7 @@ Layout/AlignHash:
   - ignore_implicit
   - ignore_explicit
 
-Layout/AlignParameters:
+Layout/ParameterAlignment:
   EnforcedStyle: with_fixed_indentation
   SupportedStyles:
   - with_first_parameter
@@ -76,13 +76,6 @@ Style/BlockDelimiters:
   - proc
   - it
 
-Style/BracesAroundHashParameters:
-  EnforcedStyle: no_braces
-  SupportedStyles:
-  - braces
-  - no_braces
-  - context_dependent
-
 Layout/CaseIndentation:
   EnforcedStyle: end
   SupportedStyles:
@@ -172,7 +165,7 @@ Naming/FileName:
   Regex:
   IgnoreExecutableScripts: true
 
-Layout/IndentFirstArgument:
+Layout/FirstArgumentIndentation:
   EnforcedStyle: consistent
   SupportedStyles:
   - consistent
@@ -202,6 +195,7 @@ Style/FrozenStringLiteralComment:
   SupportedStyles:
     - always
     - never
+  SafeAutoCorrect: true
 
 Style/GlobalVars:
   AllowedVariables: []
@@ -225,7 +219,7 @@ Layout/IndentationConsistency:
 Layout/IndentationWidth:
   Width: 2
 
-Layout/IndentFirstArrayElement:
+Layout/FirstArrayElementIndentation:
   EnforcedStyle: consistent
   SupportedStyles:
   - special_inside_parentheses
@@ -233,10 +227,10 @@ Layout/IndentFirstArrayElement:
   - align_brackets
   IndentationWidth:
 
-Layout/IndentAssignment:
+Layout/AssignmentIndentation:
   IndentationWidth:
 
-Layout/IndentFirstHashElement:
+Layout/FirstHashElementIndentation:
   EnforcedStyle: consistent
   SupportedStyles:
   - special_inside_parentheses
@@ -271,7 +265,7 @@ Style/MethodCallWithArgsParentheses:
   - raise
   - puts
   Exclude:
-  - Gemfile
+  - '**/Gemfile'
 
 Style/MethodDefParentheses:
   EnforcedStyle: require_parentheses
@@ -340,9 +334,9 @@ Style/PercentQLiterals:
 Naming/PredicateName:
   NamePrefix:
   - is_
-  NamePrefixBlacklist:
+  ForbiddenPrefixes:
   - is_
-  NameWhitelist:
+  AllowedMethods:
   - is_a?
   Exclude:
   - 'spec/**/*'
@@ -467,7 +461,7 @@ Style/TernaryParentheses:
   - require_no_parentheses
   AllowSafeAssignment: true
 
-Layout/TrailingBlankLines:
+Layout/TrailingEmptyLines:
   EnforcedStyle: final_newline
   SupportedStyles:
   - final_newline
@@ -478,7 +472,7 @@ Style/TrivialAccessors:
   AllowPredicates: true
   AllowDSLWriters: false
   IgnoreClassMethods: false
-  Whitelist:
+  AllowedMethods:
   - to_ary
   - to_a
   - to_c
@@ -509,7 +503,7 @@ Style/WhileUntilModifier:
 Metrics/BlockNesting:
   Max: 3
 
-Metrics/LineLength:
+Layout/LineLength:
   Max: 120
   AllowHeredoc: true
   AllowURI: true
@@ -561,7 +555,7 @@ Lint/UnusedMethodArgument:
 Naming/AccessorMethodName:
   Enabled: true
 
-Layout/AlignArray:
+Layout/ArrayAlignment:
   Enabled: true
 
 Style/ArrayJoin:
@@ -584,6 +578,7 @@ Layout/BlockEndNewline:
 
 Style/CaseEquality:
   Enabled: true
+  AllowOnConstant: true
 
 Style/CharacterLiteral:
   Enabled: true
@@ -666,6 +661,9 @@ Style/IfWithSemicolon:
 Style/IdenticalConditionalBranches:
   Enabled: true
 
+Layout/IndentationStyle:
+  Enabled: true
+
 Style/InfiniteLoop:
   Enabled: true
 
@@ -678,7 +676,7 @@ Style/LineEndConcatenation:
 Style/MethodCallWithoutArgsParentheses:
   Enabled: true
 
-Style/MethodMissingSuper:
+Lint/MissingSuper:
   Enabled: true
 
 Style/MissingRespondToMissing:
@@ -810,22 +808,19 @@ Layout/SpaceInsideRangeLiteral:
 Style/SymbolLiteral:
   Enabled: true
 
-Layout/Tab:
-  Enabled: true
-
 Layout/TrailingWhitespace:
   Enabled: true
 
 Style/UnlessElse:
   Enabled: true
 
-Style/UnneededCapitalW:
+Style/RedundantCapitalW:
   Enabled: true
 
-Style/UnneededInterpolation:
+Style/RedundantInterpolation:
   Enabled: true
 
-Style/UnneededPercentQ:
+Style/RedundantPercentQ:
   Enabled: true
 
 Style/VariableInterpolation:
@@ -840,8 +835,8 @@ Style/WhileUntilDo:
 Style/ZeroLengthPredicate:
   Enabled: true
 
-Layout/IndentHeredoc:
-  EnforcedStyle: squiggly
+Layout/HeredocIndentation:
+  Enabled: true
 
 Lint/AmbiguousOperator:
   Enabled: true
@@ -864,7 +859,7 @@ Lint/DeprecatedClassMethods:
 Lint/DuplicateMethods:
   Enabled: true
 
-Lint/DuplicatedKey:
+Lint/DuplicateHashKey:
   Enabled: true
 
 Lint/EachWithObjectArgument:
@@ -879,9 +874,6 @@ Lint/EmptyEnsure:
 Lint/EmptyInterpolation:
   Enabled: true
 
-Lint/EndInMethod:
-  Enabled: true
-
 Lint/EnsureReturn:
   Enabled: true
 
@@ -891,8 +883,8 @@ Lint/FloatOutOfRange:
 Lint/FormatParameterMismatch:
   Enabled: true
 
-Lint/HandleExceptions:
-  Enabled: true
+Lint/SuppressedException:
+  AllowComments: true
 
 Lint/ImplicitStringConcatenation:
   Description: Checks for adjacent string literals on the same line, which could
@@ -947,7 +939,7 @@ Lint/ShadowedException:
 Lint/ShadowingOuterLocalVariable:
   Enabled: true
 
-Lint/StringConversionInInterpolation:
+Lint/RedundantStringCoercion:
   Enabled: true
 
 Lint/UnderscorePrefixedVariableName:
@@ -956,13 +948,13 @@ Lint/UnderscorePrefixedVariableName:
 Lint/UnifiedInteger:
   Enabled: true
 
-Lint/UnneededCopDisableDirective:
+Lint/RedundantCopDisableDirective:
   Enabled: true
 
-Lint/UnneededCopEnableDirective:
+Lint/RedundantCopEnableDirective:
   Enabled: true
 
-Lint/UnneededSplatExpansion:
+Lint/RedundantSplatExpansion:
   Enabled: true
 
 Lint/UnreachableCode:
@@ -974,7 +966,7 @@ Lint/UselessAccessModifier:
 Lint/UselessAssignment:
   Enabled: true
 
-Lint/UselessComparison:
+Lint/BinaryOperatorWithIdenticalOperands:
   Enabled: true
 
 Lint/UselessElseWithoutRescue:
@@ -1025,3 +1017,6 @@ Style/ModuleFunction:
 
 Lint/OrderedMagicComments:
   Enabled: true
+
+Lint/DeprecatedOpenSSLConstant:
+  Enabled: true

+ 1 - 3
.rubocop.yml

@@ -1,8 +1,6 @@
 inherit_from:
   - https://shopify.github.io/ruby-style-guide/rubocop.yml
+  - .rubocop_todo.yml
 
 AllCops:
   TargetRubyVersion: 2.4
-
-Rails:
-  Enabled: false

+ 492 - 0
.rubocop_todo.yml

@@ -0,0 +1,492 @@
+# This configuration was generated by
+# `rubocop --auto-gen-config`
+# on 2020-10-05 17:42:41 UTC using RuboCop version 0.92.0.
+# The point is for the user to remove these configuration records
+# one by one as the offenses are removed from the code base.
+# Note that changes in the inspected code, or installation of new
+# versions of RuboCop, may require this file to be generated again.
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth.
+# SupportedStyles: case, end
+Layout/CaseIndentation:
+  Exclude:
+    - 'lib/shopify_api/countable.rb'
+
+# Offense count: 8
+# Cop supports --auto-correct.
+Layout/ClosingParenthesisIndentation:
+  Exclude:
+    - 'lib/shopify_api/resources/product.rb'
+    - 'lib/shopify_api/resources/variant.rb'
+    - 'test/application_charge_test.rb'
+    - 'test/assigned_fulfillment_order_test.rb'
+    - 'test/collection_test.rb'
+
+# Offense count: 6
+# Cop supports --auto-correct.
+# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines.
+Layout/EmptyLineBetweenDefs:
+  Exclude:
+    - 'lib/shopify_api/resources/comment.rb'
+    - 'lib/shopify_api/resources/fulfillment.rb'
+
+# Offense count: 4
+# Cop supports --auto-correct.
+Layout/EmptyLines:
+  Exclude:
+    - 'test/base_test.rb'
+    - 'test/customer_test.rb'
+    - 'test/meta_test.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: around, only_before
+Layout/EmptyLinesAroundAccessModifier:
+  Exclude:
+    - 'test/customer_saved_search_test.rb'
+    - 'test/gift_card_test.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: empty_lines, no_empty_lines
+Layout/EmptyLinesAroundBlockBody:
+  Exclude:
+    - 'test/api_version_test.rb'
+    - 'test/meta_test.rb'
+    - 'test/tax_service_test.rb'
+
+# Offense count: 24
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
+Layout/EmptyLinesAroundClassBody:
+  Enabled: false
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
+Layout/EmptyLinesAroundModuleBody:
+  Exclude:
+    - 'lib/shopify_api/session.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
+Layout/ExtraSpacing:
+  Exclude:
+    - 'lib/shopify_api/resources/product.rb'
+
+# Offense count: 6
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, IndentationWidth.
+# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
+Layout/FirstArgumentIndentation:
+  Exclude:
+    - 'test/application_charge_test.rb'
+    - 'test/assigned_fulfillment_order_test.rb'
+    - 'test/collection_test.rb'
+
+# Offense count: 12
+# Cop supports --auto-correct.
+# Configuration parameters: IndentationWidth, EnforcedStyle.
+# SupportedStyles: spaces, tabs
+Layout/IndentationStyle:
+  Exclude:
+    - 'test/fulfillment_service_test.rb'
+
+# Offense count: 4
+# Cop supports --auto-correct.
+# Configuration parameters: Width, IgnoredPatterns.
+Layout/IndentationWidth:
+  Exclude:
+    - 'test/fulfillment_service_test.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: symmetrical, new_line, same_line
+Layout/MultilineMethodCallBraceLayout:
+  Exclude:
+    - 'lib/shopify_api/resources/product.rb'
+    - 'lib/shopify_api/resources/variant.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Layout/RescueEnsureAlignment:
+  Exclude:
+    - 'lib/shopify_api/message_enricher.rb'
+
+# Offense count: 7
+# Cop supports --auto-correct.
+Layout/SpaceAfterColon:
+  Exclude:
+    - 'test/order_test.rb'
+
+# Offense count: 8
+# Cop supports --auto-correct.
+Layout/SpaceAfterComma:
+  Exclude:
+    - 'lib/active_resource/json_errors.rb'
+    - 'lib/shopify_api/session.rb'
+    - 'test/base_test.rb'
+    - 'test/fulfillment_order_test.rb'
+    - 'test/recurring_application_charge_test.rb'
+    - 'test/session_test.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: space, no_space
+Layout/SpaceAroundEqualsInParameterDefault:
+  Enabled: false
+  Exclude:
+    - 'lib/shopify_api/limits.rb'
+
+# Offense count: 9
+# Cop supports --auto-correct.
+# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
+# SupportedStylesForExponentOperator: space, no_space
+Layout/SpaceAroundOperators:
+  Exclude:
+    - 'lib/shopify_api/resources/product.rb'
+    - 'test/asset_test.rb'
+    - 'test/pagination_test.rb'
+    - 'test/shop_test.rb'
+    - 'test/test_helper.rb'
+
+# Offense count: 7
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyleForEmptyBraces.
+# SupportedStyles: space, no_space
+# SupportedStylesForEmptyBraces: space, no_space
+Layout/SpaceBeforeBlockBraces:
+  # EnforcedStyle: space
+  Enabled: false
+
+# Offense count: 4
+# Cop supports --auto-correct.
+Layout/SpaceBeforeComma:
+  Exclude:
+    - 'test/carrier_service_test.rb'
+    - 'test/fulfillment_service_test.rb'
+
+# Offense count: 4
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
+# SupportedStyles: space, no_space, compact
+# SupportedStylesForEmptyBrackets: space, no_space
+Layout/SpaceInsideArrayLiteralBrackets:
+  Enabled: false
+  # Exclude:
+  #   - 'test/resource_feedback_test.rb'
+
+# Offense count: 5
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
+# SupportedStyles: space, no_space
+# SupportedStylesForEmptyBraces: space, no_space
+Layout/SpaceInsideBlockBraces:
+  Exclude:
+    - 'lib/shopify_api/session.rb'
+    - 'test/location_test.rb'
+    - 'test/shop_test.rb'
+
+# Offense count: 93
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyleForEmptyBraces.
+# SupportedStyles: space, no_space, compact
+# SupportedStylesForEmptyBraces: space, no_space
+Layout/SpaceInsideHashLiteralBraces:
+  Enabled: false
+  # EnforcedStyle: space
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: space, no_space
+Layout/SpaceInsideParens:
+  Exclude:
+    - 'lib/shopify_api/resources/recurring_application_charge.rb'
+
+# Offense count: 5
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: final_newline, final_blank_line
+Layout/TrailingEmptyLines:
+  Exclude:
+    - 'lib/shopify_api/meta.rb'
+    - 'lib/shopify_api/resources/announcement.rb'
+    - 'lib/shopify_api/resources/cart.rb'
+    - 'test/cart_test.rb'
+    - 'test/metafield_test.rb'
+
+# Offense count: 8
+# Cop supports --auto-correct.
+# Configuration parameters: AllowInHeredoc.
+Layout/TrailingWhitespace:
+  Exclude:
+    - 'lib/shopify_api/resources/product.rb'
+    - 'lib/shopify_api/resources/variant.rb'
+    - 'test/product_test.rb'
+    - 'test/storefront_access_token_test.rb'
+    - 'test/user_test.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Lint/AmbiguousOperator:
+  Exclude:
+    - 'test/price_rule_test.rb'
+
+# Offense count: 3
+# Configuration parameters: AllowSafeAssignment.
+Lint/AssignmentInCondition:
+  Exclude:
+    - 'lib/shopify_api/session.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Lint/DeprecatedOpenSSLConstant:
+  Exclude:
+    - 'lib/shopify_api/session.rb'
+    - 'test/session_test.rb'
+
+# Offense count: 2
+Lint/MissingSuper:
+  Exclude:
+    - 'lib/shopify_api/graphql/http_client.rb'
+    - 'test/api_version_test.rb'
+
+# Offense count: 1
+# Configuration parameters: AllowComments.
+Lint/SuppressedException:
+  Exclude:
+    - 'test/test_helper.rb'
+
+# Offense count: 1
+# Configuration parameters: AllowKeywordBlockArguments.
+Lint/UnderscorePrefixedVariableName:
+  Exclude:
+    - 'lib/shopify_api/resources/base.rb'
+
+# Offense count: 12
+# Cop supports --auto-correct.
+# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
+Lint/UnusedBlockArgument:
+  Exclude:
+    - 'test/graphql_test.rb'
+    - 'test/lib/webmock_extensions/last_request.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
+Lint/UnusedMethodArgument:
+  Exclude:
+    - 'lib/shopify_api/resources/asset.rb'
+    - 'test/test_helper.rb'
+
+# Offense count: 9
+Lint/UselessAssignment:
+  Exclude:
+    - 'lib/shopify_api/resources/line_item.rb'
+    - 'test/asset_test.rb'
+    - 'test/blog_test.rb'
+    - 'test/metafield_test.rb'
+    - 'test/pagination_test.rb'
+    - 'test/tax_service_test.rb'
+
+# Offense count: 1
+# Configuration parameters: CheckForMethodsWithNoSideEffects.
+Lint/Void:
+  Exclude:
+    - 'lib/shopify_api/pagination_link_headers.rb'
+
+# Offense count: 1
+Naming/AccessorMethodName:
+  Exclude:
+    - 'test/detailed_log_subscriber_test.rb'
+
+# Offense count: 6
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: snake_case, camelCase
+Naming/VariableName:
+  Exclude:
+    - 'lib/shopify_api/resources/fulfillment.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Style/ColonMethodCall:
+  Exclude:
+    - 'test/base_test.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, AllowInnerBackticks.
+# SupportedStyles: backticks, percent_x, mixed
+Style/CommandLiteral:
+  Exclude:
+    - 'shopify_api.gemspec'
+
+# Offense count: 150
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: always, always_true, never
+Style/FrozenStringLiteralComment:
+  Enabled: false
+
+# Offense count: 500
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
+# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
+Style/HashSyntax:
+  Enabled: false
+
+# Offense count: 1
+# Configuration parameters: AllowIfModifier.
+Style/IfInsideElse:
+  Exclude:
+    - 'lib/shopify_api/graphql.rb'
+
+# Offense count: 480
+# Cop supports --auto-correct.
+# Configuration parameters: IgnoreMacros, IgnoredMethods, IgnoredPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, EnforcedStyle.
+# SupportedStyles: require_parentheses, omit_parentheses
+Style/MethodCallWithArgsParentheses:
+  Enabled: false
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: IgnoredMethods.
+Style/MethodCallWithoutArgsParentheses:
+  Exclude:
+    - 'lib/shopify_api/session.rb'
+
+# Offense count: 1
+Style/MissingRespondToMissing:
+  Exclude:
+    - 'lib/shopify_api/resources/asset.rb'
+
+# Offense count: 3
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: short, verbose
+Style/PreferredHashMethods:
+  Exclude:
+    - 'test/test_helper.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: compact, exploded
+Style/RaiseArgs:
+  Enabled: false
+  Exclude:
+    - 'lib/shopify_api/pagination_link_headers.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Style/RedundantException:
+  Exclude:
+    - 'lib/shopify_api/session.rb'
+
+# Offense count: 6
+# Cop supports --auto-correct.
+Style/RedundantPercentQ:
+  Exclude:
+    - 'shopify_api.gemspec'
+
+# Offense count: 11
+# Cop supports --auto-correct.
+Style/RedundantSelf:
+  Exclude:
+    - 'lib/shopify_api/resources/base.rb'
+    - 'lib/shopify_api/resources/custom_collection.rb'
+    - 'lib/shopify_api/resources/customer.rb'
+    - 'lib/shopify_api/resources/customer_saved_search.rb'
+    - 'lib/shopify_api/resources/product.rb'
+    - 'lib/shopify_api/resources/recurring_application_charge.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
+# SupportedStyles: slashes, percent_r, mixed
+Style/RegexpLiteral:
+  Exclude:
+    - 'lib/shopify_api/resources/image.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+Style/RescueModifier:
+  Exclude:
+    - 'lib/active_resource/json_errors.rb'
+
+# Offense count: 1
+# Cop supports --auto-correct.
+# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
+# AllowedMethods: present?, blank?, presence, try, try!
+Style/SafeNavigation:
+  Exclude:
+    - 'lib/shopify_api/resources/custom_collection.rb'
+
+# Offense count: 8
+# Cop supports --auto-correct.
+# Configuration parameters: AllowIfMethodIsEmpty.
+Style/SingleLineMethods:
+  Exclude:
+    - 'lib/shopify_api/resources/comment.rb'
+    - 'lib/shopify_api/resources/fulfillment.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyle.
+# SupportedStyles: use_perl_names, use_english_names
+Style/SpecialGlobalVars:
+  Exclude:
+    - 'lib/shopify_api.rb'
+    - 'shopify_api.gemspec'
+
+# Offense count: 7
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyleForMultiline.
+# SupportedStylesForMultiline: comma, consistent_comma, no_comma
+Style/TrailingCommaInArrayLiteral:
+  Exclude:
+    - 'shopify_api.gemspec'
+    - 'test/fulfillment_order_test.rb'
+    - 'test/fulfillment_test.rb'
+    - 'test/meta_test.rb'
+
+# Offense count: 66
+# Cop supports --auto-correct.
+# Configuration parameters: EnforcedStyleForMultiline.
+# SupportedStylesForMultiline: comma, consistent_comma, no_comma
+Style/TrailingCommaInHashLiteral:
+  Exclude:
+    - 'lib/shopify_api/metafields.rb'
+    - 'lib/shopify_api/resources/fulfillment_order.rb'
+    - 'lib/shopify_api/resources/fulfillment_v2.rb'
+    - 'lib/shopify_api/resources/inventory_level.rb'
+    - 'test/fulfillment_order_test.rb'
+    - 'test/fulfillment_test.rb'
+    - 'test/fulfillment_v2_test.rb'
+    - 'test/marketing_event_test.rb'
+    - 'test/meta_test.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods.
+# AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
+Style/TrivialAccessors:
+  Exclude:
+    - 'lib/shopify_api/graphql.rb'
+
+# Offense count: 83
+# Cop supports --auto-correct.
+# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
+# URISchemes: http, https
+Layout/LineLength:
+  Max: 320

+ 5 - 2
Rakefile

@@ -1,13 +1,16 @@
 require 'rake'
 require "bundler/gem_tasks"
-
 require 'rake/testtask'
+require 'rubocop/rake_task'
+
 Rake::TestTask.new(:test) do |test|
   test.libs << 'lib' << 'test'
   test.pattern = 'test/**/*_test.rb'
   test.warning = false
 end
 
+RuboCop::RakeTask.new
+
 begin
   require 'rcov/rcovtask'
   Rcov::RcovTask.new do |test|
@@ -21,7 +24,7 @@ rescue LoadError
   end
 end
 
-task :default => [:test, :verify_docs]
+task :default => [:test, :rubocop, :verify_docs]
 
 require 'verify_docs'
 task :verify_docs do