Skip to content

Commit

Permalink
rubocop is green
Browse files Browse the repository at this point in the history
  • Loading branch information
GBH committed Feb 8, 2018
1 parent c813a8d commit f614a49
Show file tree
Hide file tree
Showing 21 changed files with 134 additions and 360 deletions.
11 changes: 10 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,13 @@ Style/ClassAndModuleChildren:
Enabled: false

Style/AsciiComments:
Enabled: false
Enabled: false

# -- Exceptions ----------------------------------------------------------------
Performance/RedundantMerge:
Exclude:
- 'lib/bootstrap_form/view_helper.rb'

Naming/AccessorMethodName:
Exclude:
- 'lib/bootstrap_form/bootstrap_options.rb'
242 changes: 0 additions & 242 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,242 +0,0 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-02-07 15:38:11 -0800 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: 2
# Cop supports --auto-correct.
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
# Include: **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'Gemfile'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Layout/EmptyLinesAroundClassBody:
Exclude:
- 'test/bootstrap_form/radios_and_checkboxes_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLinesAroundMethodBody:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Layout/EmptyLinesAroundModuleBody:
Exclude:
- 'lib/bootstrap_form/bootstrap_options.rb'
- 'lib/bootstrap_form/form_builder.rb'
- 'lib/bootstrap_form/version.rb'
- 'lib/bootstrap_form/view_helper.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'
- 'test/bootstrap_form/fields_with_errors_test.rb'

# Offense count: 22
# Cop supports --auto-correct.
# Configuration parameters: IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/IndentHash:
EnforcedStyle: consistent

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Width, IgnoredPatterns.
Layout/IndentationWidth:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Layout/SpaceAroundOperators:
Exclude:
- 'test/bootstrap_form/fields_with_errors_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceBeforeBlockBraces:
Exclude:
- 'test/bootstrap_form/view_helpers_test.rb'

# Offense count: 12
# Cop supports --auto-correct.
Layout/SpaceInsideArrayPercentLiteral:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

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

# Offense count: 75
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Exclude:
- 'test/bootstrap_form/bootstrap_options_test.rb'
- 'test/bootstrap_form/fields_test.rb'
- 'test/bootstrap_form/fields_with_errors_test.rb'
- 'test/bootstrap_form/form_builder_test.rb'
- 'test/bootstrap_form/horizontal_form_test.rb'
- 'test/bootstrap_form/inline_form_test.rb'
- 'test/bootstrap_form/input_group_test.rb'
- 'test/bootstrap_form/radios_and_checkboxes_test.rb'
- 'test/bootstrap_form/view_helpers_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect.
# SupportedStylesAlignWith: keyword, variable, start_of_line
Lint/EndAlignment:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 1
# Configuration parameters: IgnoreImplicitReferences.
Lint/ShadowedArgument:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
Exclude:
- 'lib/bootstrap_form/view_helper.rb'
- 'test/bootstrap_form/fields_with_errors_test.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 1
Naming/AccessorMethodName:
Exclude:
- 'lib/bootstrap_form/bootstrap_options.rb'

# Offense count: 1
# Cop supports --auto-correct.
Performance/RedundantBlockCall:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: MaxKeyValuePairs.
Performance/RedundantMerge:
Exclude:
- 'lib/bootstrap_form/view_helper.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
Exclude:
- 'test/bootstrap_form/bootstrap_options_test.rb'
- 'test/bootstrap_form/form_builder_test.rb'
- 'test/bootstrap_form/horizontal_form_test.rb'
- 'test/bootstrap_form/inline_form_test.rb'

# Offense count: 1
Style/DoubleNegation:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: line_count_dependent, lambda, literal
Style/Lambda:
Exclude:
- 'test/test_helper.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/ParallelAssignment:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
- 'test/bootstrap_form/submit_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantSelf:
Exclude:
- 'lib/bootstrap_form/bootstrap_options.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'lib/bootstrap_form/bootstrap_options.rb'

# Offense count: 19
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'Rakefile'
- 'bootstrap_form.gemspec'
- 'lib/bootstrap_form.rb'
- 'test/test_helper.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'lib/bootstrap_form/form_builder.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
# SupportedStyles: percent, brackets
Style/WordArray:
Exclude:
- 'test/bootstrap_form/fields_with_errors_test.rb'
- 'test/bootstrap_form/horizontal_form_test.rb'
- 'test/bootstrap_form/radios_and_checkboxes_test.rb'
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ group :development do
end

group :test do
gem "minitest"
gem "coveralls", require: false
gem "diffy"
gem "equivalent-xml"
gem "minitest"
gem "sqlite3"
gem "coveralls", require: false
end
24 changes: 12 additions & 12 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
begin
require 'bundler/setup'
require "bundler/setup"
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
end

require 'rdoc/task'
require "rdoc/task"

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'BootstrapForm'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_dir = "rdoc"
rdoc.title = "BootstrapForm"
rdoc.options << "--line-numbers"
rdoc.rdoc_files.include("README.md")
rdoc.rdoc_files.include("lib/**/*.rb")
end

require 'bundler/gem_tasks'
require "bundler/gem_tasks"

require 'rake/testtask'
require "rake/testtask"

Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.libs << "test"
t.pattern = "test/**/*_test.rb"
t.verbose = false
end

Expand Down
2 changes: 1 addition & 1 deletion bootstrap_form.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require "bootstrap_form/version"
Expand Down
4 changes: 2 additions & 2 deletions lib/bootstrap_form.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'bootstrap_form/form_builder'
require 'bootstrap_form/view_helper'
require "bootstrap_form/form_builder"
require "bootstrap_form/view_helper"

module BootstrapForm
module Rails
Expand Down
6 changes: 2 additions & 4 deletions lib/bootstrap_form/bootstrap_options.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module BootstrapForm

# Container for bootstrap specific form builder options. It controls options
# that define form layout and grid sizing. They are passed-in into form helper
# and field helpers via `:bootstrap` option. For example:
Expand Down Expand Up @@ -73,7 +72,7 @@ def inline?
end

def offset_col_class
label_col_class.sub(/\Acol-(\w+)-(\d+)\z/, 'offset-\1-\2')
label_col_class.sub(%r{\Acol-(\w+)-(\d+)\z}, 'offset-\1-\2')
end

# This will return a copy of BootstrapOptions object with new options set
Expand All @@ -86,7 +85,7 @@ def offset_col_class
# end
#
def scoped(options = {})
scope = self.clone
scope = clone
scope.set_options(options)
scope
end
Expand All @@ -113,5 +112,4 @@ def set_defaults
end

end

end
Loading

0 comments on commit f614a49

Please sign in to comment.