Skip to content

Commit

Permalink
Update rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer authored and Jessie Keck committed Jan 5, 2021
1 parent b41ddc6 commit bbefa05
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 30 deletions.
78 changes: 76 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
inherit_from: .rubocop_todo.yml
require:
- rubocop-rails
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 2.7
Exclude:
- 'Gemfile'
- 'bin/**/*'
Expand All @@ -14,9 +17,80 @@ AllCops:
Rails:
Enabled: true

Metrics/LineLength:
Layout/LineLength:
Max: 160

Style/StringLiterals:
Enabled: true
EnforcedStyle: single_quotes

Layout/SpaceBeforeBrackets: # (new in 1.7)
Enabled: true
Lint/AmbiguousAssignment: # (new in 1.7)
Enabled: true
Lint/DuplicateBranch: # (new in 1.3)
Enabled: true
Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
Enabled: true
Lint/EmptyBlock: # (new in 1.1)
Enabled: true
Lint/EmptyClass: # (new in 1.3)
Enabled: true
Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
Enabled: true
Lint/ToEnumArguments: # (new in 1.1)
Enabled: true
Lint/UnexpectedBlockArity: # (new in 1.5)
Enabled: true
Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
Enabled: true
Style/ArgumentsForwarding: # (new in 1.1)
Enabled: true
Style/CollectionCompact: # (new in 1.2)
Enabled: true
Style/DocumentDynamicEvalDefinition: # (new in 1.1)
Enabled: true
Style/HashExcept: # (new in 1.7)
Enabled: true
Style/NegatedIfElseCondition: # (new in 1.2)
Enabled: true
Style/NilLambda: # (new in 1.3)
Enabled: true
Style/RedundantArgument: # (new in 1.4)
Enabled: true
Style/SwapValues: # (new in 1.1)
Enabled: true
Rails/ActiveRecordCallbacksOrder: # (new in 2.7)
Enabled: true
Rails/AfterCommitOverride: # (new in 2.8)
Enabled: true
Rails/AttributeDefaultBlockValue: # (new in 2.9)
Enabled: true
Rails/FindById: # (new in 2.7)
Enabled: true
Rails/Inquiry: # (new in 2.7)
Enabled: true
Rails/MailerName: # (new in 2.7)
Enabled: true
Rails/MatchRoute: # (new in 2.7)
Enabled: true
Rails/NegateInclude: # (new in 2.7)
Enabled: true
Rails/Pluck: # (new in 2.7)
Enabled: true
Rails/PluckInWhere: # (new in 2.7)
Enabled: true
Rails/RenderInline: # (new in 2.7)
Enabled: true
Rails/RenderPlainText: # (new in 2.7)
Enabled: true
Rails/ShortI18n: # (new in 2.7)
Enabled: true
Rails/SquishedSQLHeredocs: # (new in 2.8)
Enabled: true
Rails/WhereEquals: # (new in 2.9)
Enabled: true
Rails/WhereExists: # (new in 2.7)
Enabled: true
Rails/WhereNot: # (new in 2.8)
Enabled: true
172 changes: 146 additions & 26 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,177 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-11-27 10:08:55 -0800 using RuboCop version 0.60.0.
# on 2021-01-05 16:11:28 UTC using RuboCop version 1.7.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: 2
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Layout/EmptyLineBetweenDefs:
Exclude:
- 'app/models/ldap_search.rb'

# Offense count: 1
# Cop supports --auto-correct.
Lint/NonDeterministicRequireOrder:
Exclude:
- 'spec/rails_helper.rb'

# Offense count: 1
# Cop supports --auto-correct.
Lint/RedundantStringCoercion:
Exclude:
- 'app/models/ldap_search.rb'

# Offense count: 1
# Configuration parameters: Methods.
Lint/UnexpectedBlockArity:
Exclude:
- 'app/models/ldap_search.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowComments.
Lint/UselessMethodDefinition:
Exclude:
- 'app/models/person.rb'

# Offense count: 1
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 32
Max: 38

# Offense count: 7
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
Metrics/BlockLength:
Max: 109

# Offense count: 1
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 10
Max: 14

# Offense count: 3
# Configuration parameters: CountComments, ExcludedMethods.
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 23

# Offense count: 1
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 12
Max: 16

# Offense count: 2
# Configuration parameters: Blacklist.
# Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
# Configuration parameters: ForbiddenDelimiters.
# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Naming/HeredocDelimiterNaming:
Exclude:
- 'spec/models/ldap_search_spec.rb'

# Offense count: 2
# Configuration parameters: EnforcedStyle.
# Configuration parameters: EnforcedStyle, IgnoredPatterns.
# SupportedStyles: snake_case, camelCase
Naming/MethodName:
Exclude:
- 'app/models/person.rb'

# Offense count: 1
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db
Naming/UncommunicativeMethodParamName:
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'app/models/person.rb'

# Offense count: 2
# Offense count: 4
# Configuration parameters: EnforcedStyle.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Exclude:
- 'app/models/person.rb'

# Offense count: 2
# Offense count: 1
RSpec/AnyInstance:
Exclude:
- 'spec/models/person_spec.rb'

# Offense count: 24
# Cop supports --auto-correct.
# Configuration parameters: Whitelist.
# Whitelist: find_by_sql
Rails/DynamicFindBy:
# Configuration parameters: SkipBlocks, EnforcedStyle.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
Exclude:
- 'app/models/person.rb'
- 'spec/models/ldap_search_spec.rb'
- 'spec/models/person_spec.rb'

# Offense count: 1
# Offense count: 3
# Configuration parameters: Max.
RSpec/ExampleLength:
Exclude:
- 'spec/models/person_spec.rb'
- 'spec/views/organizations/edit.html.erb_spec.rb'
- 'spec/views/organizations/new.html.erb_spec.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
Rails/FilePath:
# SupportedStyles: implicit, each, example
RSpec/HookArgument:
Exclude:
- 'spec/rails_helper.rb'
- 'spec/views/organizations/edit.html.erb_spec.rb'
- 'spec/views/organizations/index.html.erb_spec.rb'
- 'spec/views/organizations/new.html.erb_spec.rb'
- 'spec/views/organizations/show.html.erb_spec.rb'

# Offense count: 1
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Exclude:
- 'spec/views/organizations/edit.html.erb_spec.rb'

# Offense count: 14
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
EnforcedStyle: receive

# Offense count: 10
RSpec/MultipleExpectations:
Max: 5

# Offense count: 6
# Configuration parameters: IgnoreSharedExamples.
RSpec/NamedSubject:
Exclude:
- 'spec/models/ldap_search_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: numeric, symbolic
RSpec/Rails/HttpStatus:
Exclude:
- 'spec/requests/organizations_spec.rb'

# Offense count: 12
RSpec/StubbedMock:
Exclude:
- 'spec/models/ldap_search_spec.rb'
- 'spec/models/person_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers.
# Whitelist: find_by_sql
# AllowedMethods: find_by_sql
# AllowedReceivers: Gem::Specification
Rails/DynamicFindBy:
Exclude:
- 'app/models/person.rb'
- 'spec/models/person_spec.rb'

# Offense count: 1
# Configuration parameters: Include.
Expand All @@ -87,13 +187,33 @@ Rails/InverseOf:
Exclude:
- 'app/models/organization.rb'

# Offense count: 5
# Offense count: 4
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'app/controllers/application_controller.rb'
- 'app/controllers/organizations_controller.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/organizations_helper.rb'
- 'app/models/person.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'config.ru'

# Offense count: 1
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'app/models/ldap_search.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'config.ru'
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ group :development, :test do

# Rubocop is a static code analyzer to enforce style.
gem 'rubocop', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false

# scss-lint will test the scss files to enfoce styles
gem 'scss-lint', require: false
Expand Down
13 changes: 11 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ GEM
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.10.0)
rubocop (1.6.1)
rubocop (1.7.0)
parallel (~> 1.10)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
Expand All @@ -273,8 +273,15 @@ GEM
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.3.0)
rubocop-ast (1.4.0)
parser (>= 2.7.1.5)
rubocop-rails (2.9.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.90.0, < 2.0)
rubocop-rspec (2.1.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
ruby_dep (1.5.0)
Expand Down Expand Up @@ -371,6 +378,8 @@ DEPENDENCIES
rails-controller-testing
rspec-rails
rubocop
rubocop-rails
rubocop-rspec
sass-rails (~> 5.0)
scss-lint
selenium-webdriver
Expand Down

0 comments on commit bbefa05

Please sign in to comment.