Skip to content

Commit

Permalink
Add bixby gem and generate new robocop todo
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed Jul 25, 2018
1 parent 45527d6 commit addfdcf
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 83 deletions.
48 changes: 20 additions & 28 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
require: rubocop-rspec

inherit_gem:
bixby: bixby_default.yml

inherit_from: .rubocop_todo.yml

Rails:
Enabled: true

AllCops:
DisplayCopNames: true

Include:
- '**/Rakefile'

Exclude:
- 'db/**/*'
- 'vendor/**/*'
Expand All @@ -17,6 +20,15 @@ AllCops:
- 'geoblacklight.gemspec'
- 'Gemfile'

Layout/DotPosition:
Description: Checks the position of the dot in multi-line method calls.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
Enabled: true
EnforcedStyle: leading
SupportedStyles:
- leading
- trailing

Metrics/LineLength:
Max: 100
Exclude:
Expand All @@ -25,37 +37,26 @@ Metrics/LineLength:
- 'lib/generators/geoblacklight/install_generator.rb'
- 'lib/tasks/geoblacklight.rake'

# TODO: Refactor large methods.
Metrics/AbcSize:
Max: 23

Metrics/MethodLength:
Max: 16

# TODO: Add top-level class and module documentation.
Style/Documentation:
Enabled: false

# Overrides method in blacklight. Must use method name.
Style/PredicateName:
Naming/PredicateName:
Exclude:
- 'lib/geoblacklight/view_helper_override.rb'

RSpec/FilePath:
Enabled: false

# Rubocop bug causes view specs to fail.
# https://github.com/nevir/rubocop-rspec/issues/47
RSpec/DescribeClass:
Enabled: false

# geoblacklight references in solr_document_spec are
# difficult to mock because of the use of 'method_missing'.
# https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles/dynamic-classes
RSpec/AnyInstance:
Exclude:
- 'spec/models/concerns/geoblacklight/solr_document_spec.rb'

# Rubocop bug causes view specs to fail.
# https://github.com/nevir/rubocop-rspec/issues/47
RSpec/DescribeClass:
Enabled: false

Style/SignalException:
EnforcedStyle: semantic

Expand All @@ -64,12 +65,3 @@ Style/StringLiterals:
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
Enabled: true
EnforcedStyle: single_quotes

Style/DotPosition:
Description: Checks the position of the dot in multi-line method calls.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
Enabled: true
EnforcedStyle: leading
SupportedStyles:
- leading
- trailing
158 changes: 107 additions & 51 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-02-05 12:43:46 -0700 using RuboCop version 0.52.1.
# on 2018-07-24 14:15:32 -0500 using RuboCop version 0.52.1.
# 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/EmptyLineAfterMagicComment:
Exclude:
- 'Rakefile'

# Offense count: 1
# Offense count: 17
# Cop supports --auto-correct.
# Configuration parameters: Width, IgnoredPatterns.
Layout/IndentationWidth:
Exclude:
- 'lib/tasks/geoblacklight.rake'
Enabled: false

# Offense count: 1
# Cop supports --auto-correct.
Expand All @@ -26,19 +19,14 @@ Layout/SpaceBeforeFirstArg:
Exclude:
- 'app/views/relation/index.json.jbuilder'

# Offense count: 1
Lint/BooleanSymbol:
Exclude:
- 'spec/features/metadata_panel_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
Exclude:
- 'lib/tasks/geoblacklight.rake'

# Offense count: 34
# Offense count: 37
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 227
Expand All @@ -50,22 +38,114 @@ Performance/HashEachMethods:
Exclude:
- 'app/presenters/geoblacklight/document_presenter.rb'

# Offense count: 2
# Configuration parameters: CustomIncludeMethods.
RSpec/EmptyExampleGroup:
Exclude:
- 'spec/views/catalog/_document_split.html.erb_spec.rb'
- 'spec/views/catalog/_index_split.html.erb_spec.rb'

# Offense count: 24
# Configuration parameters: Max.
RSpec/ExampleLength:
Exclude:
- 'spec/features/download_layer_spec.rb'
- 'spec/features/home_page_spec.rb'
- 'spec/features/index_map_spec.rb'
- 'spec/features/metadata_panel_spec.rb'
- 'spec/features/saved_searches_spec.rb'
- 'spec/features/search_results_map_spec.rb'
- 'spec/features/show_page_metadata_spec.rb'
- 'spec/features/split_view.html.erb_spec.rb'
- 'spec/features/web_services_modal_spec.rb'
- 'spec/helpers/geoblacklight_helper_spec.rb'
- 'spec/models/concerns/geoblacklight/solr_document/carto_spec.rb'
- 'spec/models/concerns/geoblacklight/solr_document/finder_spec.rb'
- 'spec/views/catalog/_downloads.html.erb_spec.rb'

# Offense count: 2
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, each, example
RSpec/HookArgument:
Exclude:
- 'spec/spec_helper.rb'
- 'spec/views/catalog/_downloads.html.erb_spec.rb'

# Offense count: 9
RSpec/LeadingSubject:
Exclude:
- 'spec/lib/geoblacklight/document_presenter_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer/base_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer_spec.rb'
- 'spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb'

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

# Offense count: 38
RSpec/NamedSubject:
Exclude:
- 'spec/lib/geoblacklight/metadata/base_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer/base_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer_spec.rb'
- 'spec/models/concerns/geoblacklight/solr_document/carto_spec.rb'
- 'spec/models/concerns/geoblacklight/solr_document/finder_spec.rb'
- 'spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb'
- 'spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb'

# Offense count: 6
RSpec/RepeatedDescription:
Exclude:
- 'spec/features/esri_viewer_spec.rb'
- 'spec/features/search_results_map_spec.rb'
- 'spec/lib/geoblacklight/references_spec.rb'

# Offense count: 2
RSpec/RepeatedExample:
Exclude:
- 'spec/features/esri_viewer_spec.rb'

# Offense count: 1
RSpec/SubjectStub:
Exclude:
- 'spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb'

# Offense count: 12
# Configuration parameters: IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/helpers/geoblacklight_helper_spec.rb'
- 'spec/lib/geoblacklight/document_presenter_spec.rb'
- 'spec/lib/geoblacklight/download_spec.rb'
- 'spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb'
- 'spec/lib/geoblacklight/wms_layer_spec.rb'
- 'spec/models/concerns/geoblacklight/solr_document/finder_spec.rb'
- 'spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb'
- 'spec/views/catalog/_downloads.html.erb_spec.rb'

# Offense count: 7
Rails/FilePath:
Exclude:
- 'lib/geoblacklight/download.rb'
- 'lib/tasks/geoblacklight.rake'
- 'spec/lib/geoblacklight/download_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer/fgdc_spec.rb'
- 'spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb'

# Offense count: 6
Rails/OutputSafety:
Exclude:
- 'app/controllers/download_controller.rb'
- 'app/helpers/geoblacklight_helper.rb'
- 'lib/geoblacklight/view_helper_override.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank.
Rails/Present:
Exclude:
- 'app/models/concerns/geoblacklight/solr_document.rb'
- 'app/presenters/geoblacklight/document_presenter.rb'
- 'lib/geoblacklight/references.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/ColonMethodCall:
Expand All @@ -86,12 +166,6 @@ Style/EmptyLiteral:
Exclude:
- 'spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/Encoding:
Exclude:
- 'Rakefile'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
Expand All @@ -112,30 +186,19 @@ Style/MultilineIfModifier:
Exclude:
- 'lib/geoblacklight/references.rb'

# Offense count: 11
# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
- 'app/models/concerns/geoblacklight/solr_document/inspection.rb'
- 'spec/helpers/geoblacklight_helper_spec.rb'
- 'spec/lib/geoblacklight/document_presenter_spec.rb'
- 'spec/lib/geoblacklight/references_spec.rb'
- 'spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb'
- 'spec/models/concerns/geoblacklight/solr_document/finder_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, explicit
Style/RescueStandardError:
Exclude:
- 'app/helpers/geoblacklight_helper.rb'
- 'lib/geoblacklight/metadata.rb'
- 'lib/geoblacklight/metadata_transformer.rb'
- 'lib/geoblacklight/metadata_transformer/base.rb'
- 'lib/tasks/geoblacklight.rake'

# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
Expand All @@ -144,13 +207,6 @@ Style/StringLiterals:
Exclude:
- 'lib/tasks/geoblacklight.rake'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: MinSize.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets

# Offense count: 1
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Expand Down
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ source 'https://rubygems.org'
gemspec

group :development, :test do
gem 'coveralls', require: false
# Peg simplecov to < 0.8 until this is resolved:
# https://github.com/colszowka/simplecov/issues/281
gem 'simplecov', '~> 0.7.1', require: false
gem 'coveralls', require: false
gem 'rubocop', '~> 0.49', require: false
gem 'rubocop-rspec', '~> 1.22.0', require: false

# See https://github.com/rails/rails/issues/32955
gem 'thor', '>= 0.19.0'
end
Expand Down
1 change: 1 addition & 0 deletions geoblacklight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'chromedriver-helper'
spec.add_development_dependency 'factory_bot_rails'
spec.add_development_dependency 'database_cleaner', '~> 1.3'
spec.add_development_dependency 'bixby'
end

0 comments on commit addfdcf

Please sign in to comment.