Skip to content

Commit

Permalink
[TASK] Add RuboCop checking to the CI (#52)
Browse files Browse the repository at this point in the history
This commit only add the checks. It does not fix the warnings yet,
but whitelists them instead so they can be fixed in separate PRs.

Fixes #14
  • Loading branch information
oliverklee authored and lwe committed Jan 26, 2017
1 parent 2e16f6e commit 5914867
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 0 deletions.
125 changes: 125 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-01-20 12:42:30 +0100 using RuboCop version 0.47.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: 4
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
Exclude:
- 'lib/page_title_helper.rb'
- 'test/page_title_helper_test.rb'

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

# Offense count: 1
Metrics/AbcSize:
Max: 22

# Offense count: 2
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 101

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 103

# Offense count: 33
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 172

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
Exclude:
- 'test/page_title_helper_test.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Style/EmptyLinesAroundModuleBody:
Exclude:
- 'lib/page_title_helper.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Style/ExtraSpacing:
Exclude:
- 'test/page_title_helper_test.rb'

# Offense count: 1
# Configuration parameters: ExpectMatchingDefinition, 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
Style/FileName:
Exclude:
- 'Appraisals'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'gemfiles/rails_4.2.gemfile'
- 'gemfiles/rails_5.0.gemfile'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: normal, rails
Style/IndentationConsistency:
Exclude:
- 'lib/page_title_helper.rb'

# Offense count: 1
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: module_function, extend_self
Style/ModuleFunction:
Exclude:
- 'lib/page_title_helper.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'lib/page_title_helper/version.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantSelf:
Exclude:
- 'test/test_helper.rb'

# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'gemfiles/rails_4.2.gemfile'
- 'gemfiles/rails_5.0.gemfile'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
# Whitelist: 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:
- 'test/test_helper.rb'
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ gemfile:

script:
- bundle exec rake --trace test
- bundle exec rubocop gemfiles/*.gemfile lib/ test/ Appraisals Gemfile init.rb Rakefile

matrix:
fast_finish: true
Expand Down
1 change: 1 addition & 0 deletions page_title_helper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'appraisal'
s.add_development_dependency 'rake', '>= 10.3.2'
s.add_development_dependency 'shoulda'
s.add_development_dependency 'rubocop', '~> 0.47.1'
end

0 comments on commit 5914867

Please sign in to comment.