Skip to content

Commit

Permalink
chore: Added rubocop configs and changed source files with rubocop "o…
Browse files Browse the repository at this point in the history
…ffenses" (sendgrid#339)
  • Loading branch information
douglaslise authored Sep 14, 2020
1 parent 1d1bf33 commit c816a0c
Show file tree
Hide file tree
Showing 72 changed files with 2,833 additions and 2,580 deletions.
13 changes: 7 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
AllCops:
Exclude:
- examples/**/*
- gemfiles/**/*
- spec/**/*
- test/**/*
inherit_from: .rubocop_todo.yml

Metrics/LineLength:
Max: 120

Style/StringLiterals:
Enabled: false
321 changes: 321 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,321 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-09-09 23:09:21 UTC using RuboCop version 0.90.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.
Layout/BlockEndNewline:
Exclude:
- 'spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Layout/ClosingParenthesisIndentation:
Exclude:
- 'examples/helpers/eventwebhook/example.rb'

# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'lib/rack/sendgrid_webhook_verification.rb'

# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLineAfterMagicComment:
Exclude:
- 'test/sendgrid/helpers/mail/test_attachment.rb'

# Offense count: 2
# 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:
Exclude:
- 'test/sendgrid/permissions/test_scopes.rb'

# Offense count: 7
# 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:
- 'examples/helpers/eventwebhook/example.rb'
- 'spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/FirstHashElementIndentation:
Exclude:
- 'spec/fixtures/event_webhook.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Exclude:
- 'spec/fixtures/event_webhook.rb'

# Offense count: 27
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 381

# Offense count: 1
# Cop supports --auto-correct.
Layout/MultilineBlockLayout:
Exclude:
- 'spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
# SupportedStylesForExponentOperator: space, no_space
Layout/SpaceAroundOperators:
Exclude:
- 'spec/fixtures/event_webhook.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceBeforeBlockBraces:
EnforcedStyle: space

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideBlockBraces:
Exclude:
- 'examples/ips/ips.rb'
- 'lib/sendgrid/helpers/ip_management/ip_management.rb'

# Offense count: 8
# Cop supports --auto-correct.
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'examples/helpers/mail/example.rb'
- 'examples/mail/mail.rb'
- 'lib/sendgrid/helpers/permissions/scope.rb'
- 'spec/fixtures/event_webhook.rb'
- 'spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb'
- 'test/sendgrid/helpers/mail/test_attachment.rb'

# Offense count: 2
Lint/ImplicitStringConcatenation:
Exclude:
- 'test/sendgrid/helpers/mail/test_attachment.rb'

# Offense count: 16
Lint/UselessAssignment:
Exclude:
- 'spec/rack/sendgrid_webhook_verification_spec.rb'

# Offense count: 4
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
Max: 144

# Offense count: 9
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 96

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 123

# Offense count: 14
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
Metrics/MethodLength:
Max: 83

# Offense count: 1
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 6

# Offense count: 3
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
Naming/FileName:
Exclude:
- 'gemfiles/Sinatra_1.gemfile'
- 'gemfiles/Sinatra_2.gemfile'
- 'lib/sendgrid-ruby.rb'

# Offense count: 1
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
# NamePrefix: is_, has_, have_
# ForbiddenPrefixes: is_, has_, have_
# AllowedMethods: is_a?
# MethodDefinitionMacros: define_method, define_singleton_method
Naming/PredicateName:
Exclude:
- 'spec/**/*'
- 'examples/helpers/eventwebhook/example.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
# FunctionalMethods: let, let!, subject, watch
# IgnoredMethods: lambda, proc, it
Style/BlockDelimiters:
Exclude:
- 'spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb'

# Offense count: 14
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/sendgrid/helpers/inbound/app.rb'
- 'lib/sendgrid/helpers/ip_management/ip_management.rb'
- 'lib/sendgrid/helpers/mail/category.rb'
- 'lib/sendgrid/helpers/permissions/scope.rb'
- 'lib/sendgrid/helpers/settings/mail_settings_dto.rb'
- 'lib/sendgrid/helpers/settings/partner_settings_dto.rb'
- 'lib/sendgrid/helpers/settings/settings.rb'
- 'lib/sendgrid/helpers/settings/tracking_settings_dto.rb'
- 'lib/sendgrid/helpers/settings/user_settings_dto.rb'
- 'lib/sendgrid/helpers/stats/email_stats.rb'
- 'lib/sendgrid/helpers/stats/metrics.rb'
- 'lib/sendgrid/helpers/stats/stats_response.rb'
- 'lib/sendgrid/sendgrid.rb'
- 'lib/sendgrid/twilio_email.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, expanded
Style/EmptyMethod:
Exclude:
- 'test/sendgrid/helpers/mail/test_attachment.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/Encoding:
Exclude:
- 'test/sendgrid/helpers/mail/test_attachment.rb'

# Offense count: 4
# Configuration parameters: EnforcedStyle.
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
Exclude:
- 'examples/emailactivity/emailactivity.rb'

# Offense count: 72
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 2
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'lib/rack/sendgrid_webhook_verification.rb'
- 'lib/sendgrid/helpers/eventwebhook/eventwebhook.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'lib/sendgrid/helpers/eventwebhook/eventwebhook.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
Style/MethodCallWithoutArgsParentheses:
Exclude:
- 'examples/emailactivity/emailactivity.rb'

# Offense count: 5
Style/MixinUsage:
Exclude:
- 'examples/helpers/eventwebhook/example.rb'
- 'examples/helpers/mail/example.rb'
- 'examples/helpers/settings/example.rb'
- 'examples/helpers/stats/example.rb'
- 'test/sendgrid/helpers/mail/test_attachment.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/sendgrid/helpers/eventwebhook/eventwebhook.rb'
- 'spec/fixtures/event_webhook.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/OrAssignment:
Exclude:
- 'lib/sendgrid/sendgrid.rb'
- 'lib/sendgrid/twilio_email.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantCondition:
Exclude:
- 'lib/sendgrid/base_interface.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'lib/rack/sendgrid_webhook_verification.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'spec/rack/sendgrid_webhook_verification_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, explicit
Style/RescueStandardError:
Exclude:
- 'lib/sendgrid/helpers/eventwebhook/eventwebhook.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'spec/fixtures/event_webhook.rb'

# Offense count: 27
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 381
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ end
RSpec::Core::RakeTask.new(:spec)

desc "Run tests"
task default: [:spec, :test]

task default: %i[spec test]
Loading

0 comments on commit c816a0c

Please sign in to comment.