Skip to content

Commit

Permalink
Rubocop lint tests from @mlafeldt
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit c5f2df3b961b65badae8ec4c9d00c991e962bf79
Author: Jordan Byron <jordan.byron@gmail.com>
Date:   Tue Feb 4 11:06:10 2014 -0500

    Run rubocop tests with the rest of the test suite

commit c55cb4539233a37ffe59f3d5fcecb38ce866209b
Merge: f5f475c 5de51a4
Author: Jordan Byron <jordan.byron@gmail.com>
Date:   Tue Feb 4 11:01:29 2014 -0500

    Merge branch 'rubocop' of git://github.com/mlafeldt/practicing-ruby-web into mlafeldt-rubocop

    Conflicts:
    	Gemfile.lock

commit 5de51a4
Author: Mathias Lafeldt <mathias.lafeldt@gmail.com>
Date:   Sun Feb 2 23:17:21 2014 +0100

    Add RuboCop Rake task

commit d52b2ba
Author: Mathias Lafeldt <mathias.lafeldt@gmail.com>
Date:   Sun Feb 2 23:12:27 2014 +0100

    Disable more cops so that no offenses are reported

commit 7c71190
Author: Mathias Lafeldt <mathias.lafeldt@gmail.com>
Date:   Sun Feb 2 23:08:13 2014 +0100

    Re-generate todo list with newer version of RuboCop

    using `rubocop --rails --auto-gen-config`

commit 4b27a1a
Author: Mathias Lafeldt <mathias.lafeldt@gmail.com>
Date:   Sun Feb 2 23:05:43 2014 +0100

    Inherit from todo list again

commit b10fe87
Author: Mathias Lafeldt <mathias.lafeldt@gmail.com>
Date:   Sun Feb 2 22:59:20 2014 +0100

    Update rainbow gem to use latest version of rubocop

commit dd63876
Author: Mathias Lafeldt <mathias.lafeldt@gmail.com>
Date:   Sun Feb 2 20:36:19 2014 +0100

    Disable cops requested by Greg

commit 87edc8a
Author: Mathias Lafeldt <mathias.lafeldt@gmail.com>
Date:   Sun Feb 2 18:39:01 2014 +0100

    Add rubocop config files

commit d23a5b0
Author: Mathias Lafeldt <mathias.lafeldt@gmail.com>
Date:   Sun Feb 2 18:38:21 2014 +0100

    Add rubocop to Gemfile
  • Loading branch information
jordanbyron committed Feb 4, 2014
1 parent f5f475c commit c00a3c4
Show file tree
Hide file tree
Showing 6 changed files with 304 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,10 @@
inherit_from: rubocop-todo.yml

HashSyntax:
Enabled: false
IfUnlessModifier:
Enabled: false
SignalException:
Enabled: false
StringLiterals:
Enabled: false
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -72,6 +72,7 @@ group :test do
gem 'turn', '~> 0.9.5'
gem 'simplecov', :require => false
gem 'poltergeist'
gem 'rubocop', '~> 0.18.1'
end

group :production do
Expand Down
14 changes: 13 additions & 1 deletion Gemfile.lock
Expand Up @@ -39,6 +39,7 @@ GEM
posix-spawn (>= 0.3.6)
ansi (1.4.2)
arel (3.0.3)
ast (1.1.0)
builder (3.0.4)
capistrano (2.13.5)
highline
Expand Down Expand Up @@ -195,6 +196,9 @@ GEM
omniauth-oauth2 (1.1.1)
oauth2 (~> 0.8.0)
omniauth (~> 1.0)
parser (2.1.4)
ast (~> 1.1)
slop (~> 3.4, >= 3.4.5)
parsley-rails (1.2.2.0)
railties (>= 3.0.0)
pg (0.16.0)
Expand All @@ -204,6 +208,7 @@ GEM
http_parser.rb (~> 0.5.3)
polyglot (0.3.3)
posix-spawn (0.3.6)
powerpack (0.0.9)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
Expand Down Expand Up @@ -235,14 +240,19 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rainbow (1.1.4)
rainbow (2.0.0)
raindrops (0.11.0)
rake (0.9.6)
rdoc (3.12.2)
json (~> 1.4)
request_store (1.0.5)
rest-client (1.6.7)
mime-types (>= 1.16)
rubocop (0.18.1)
json (>= 1.7.7, < 2)
parser (~> 2.1.3)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
rubyzip (0.9.9)
sass (3.1.19)
sass-rails (3.2.5)
Expand All @@ -267,6 +277,7 @@ GEM
skinny (0.2.3)
eventmachine (~> 1.0.0)
thin (~> 1.5.0)
slop (3.4.7)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
Expand Down Expand Up @@ -361,6 +372,7 @@ DEPENDENCIES
rails_setup
rake (~> 0.9.0)
redcarpet!
rubocop (~> 0.18.1)
sass-rails (~> 3.2.0)
sassy-buttons
simplecov
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Expand Up @@ -6,3 +6,5 @@ require 'rake'
require File.expand_path('../lib/rake_exception_notification', __FILE__)

PracticingRubyWeb::Application.load_tasks

Rake::Task[:test].enhance { Rake::Task["test:rubocop"].invoke }
8 changes: 8 additions & 0 deletions lib/tasks/rubocop.rake
@@ -0,0 +1,8 @@
require "rubocop/rake_task"

namespace :test do
desc "Run RuboCop style and lint checks"
Rubocop::RakeTask.new(:rubocop) do |t|
t.options = ["--rails"]
end
end
270 changes: 270 additions & 0 deletions rubocop-todo.yml
@@ -0,0 +1,270 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2014-02-02 23:06:59 +0100 using RuboCop version 0.18.1.
# The point is for the user to remove these configuration records
# one by one as the offences 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.

# Offence count: 1
AccessorMethodName:
Enabled: false

# Offence count: 2
# Cop supports --auto-correct.
AlignArray:
Enabled: false

# Offence count: 26
# Cop supports --auto-correct.
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle.
AlignHash:
Enabled: false

# Offence count: 29
# Cop supports --auto-correct.
AlignParameters:
Enabled: false

# Offence count: 1
AmbiguousOperator:
Enabled: false

# Offence count: 1
AmbiguousRegexpLiteral:
Enabled: false

# Offence count: 3
# Cop supports --auto-correct.
AndOr:
Enabled: false

# Offence count: 3
# Configuration parameters: AllowSafeAssignment.
AssignmentInCondition:
Enabled: false

# Offence count: 6
BlockAlignment:
Enabled: false

# Offence count: 5
# Cop supports --auto-correct.
Blocks:
Enabled: false

# Offence count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
BracesAroundHashParameters:
Enabled: false

# Offence count: 2
# Configuration parameters: CountComments.
ClassLength:
Max: 186

# Offence count: 2
# Cop supports --auto-correct.
ColonMethodCall:
Enabled: false

# Offence count: 3
# Configuration parameters: Keywords.
CommentAnnotation:
Enabled: false

# Offence count: 1
ConstantName:
Enabled: false

# Offence count: 126
Documentation:
Enabled: false

# Offence count: 8
# Configuration parameters: Style, SupportedStyles.
DotPosition:
Enabled: false

# Offence count: 10
# Cop supports --auto-correct.
EmptyLines:
Enabled: false

# Offence count: 19
# Cop supports --auto-correct.
EmptyLinesAroundBody:
Enabled: false

# Offence count: 2
# Configuration parameters: AlignWith, SupportedStyles.
EndAlignment:
Enabled: false

# Offence count: 1
FavorSprintf:
Enabled: false

# Offence count: 1
FavorUnlessOverNegatedIf:
Enabled: false

# Offence count: 17
# Cop supports --auto-correct.
FinalNewline:
Enabled: false

# Offence count: 513
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
HashSyntax:
Enabled: false

# Offence count: 2
IfUnlessModifier:
Enabled: false

# Offence count: 1
Lambda:
Enabled: false

# Offence count: 6
# Cop supports --auto-correct.
LeadingCommentSpace:
Enabled: false

# Offence count: 1
# Cop supports --auto-correct.
LineEndConcatenation:
Enabled: false

# Offence count: 132
LineLength:
Max: 139

# Offence count: 20
# Configuration parameters: CountComments.
MethodLength:
Max: 25

# Offence count: 2
ModuleFunction:
Enabled: false

# Offence count: 2
# Cop supports --auto-correct.
NumericLiterals:
Enabled: false

# Offence count: 5
# Configuration parameters: Ignore.
Output:
Enabled: false

# Offence count: 2
ParenthesesAsGroupedExpression:
Enabled: false

# Offence count: 4
# Cop supports --auto-correct.
PerlBackrefs:
Enabled: false

# Offence count: 1
# Configuration parameters: NamePrefixBlacklist.
PredicateName:
Enabled: false

# Offence count: 1
# Configuration parameters: EnforcedStyle, SupportedStyles.
RaiseArgs:
Enabled: false

# Offence count: 1
RedundantBegin:
Enabled: false

# Offence count: 3
RegexpLiteral:
MaxSlashes: 2

# Offence count: 1
RescueException:
Enabled: false

# Offence count: 11
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
SignalException:
Enabled: false

# Offence count: 3
# Cop supports --auto-correct.
SpaceAfterComma:
Enabled: false

# Offence count: 5
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
SpaceAroundBlockBraces:
Enabled: false

# Offence count: 22
# Cop supports --auto-correct.
SpaceAroundEqualsInParameterDefault:
Enabled: false

# Offence count: 2
# Cop supports --auto-correct.
SpaceAroundOperators:
Enabled: false

# Offence count: 7
# Cop supports --auto-correct.
SpaceInsideBrackets:
Enabled: false

# Offence count: 8
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles.
SpaceInsideHashLiteralBraces:
Enabled: false

# Offence count: 10
# Cop supports --auto-correct.
SpaceInsideParens:
Enabled: false

# Offence count: 674
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
StringLiterals:
Enabled: false

# Offence count: 1
Tab:
Enabled: false

# Offence count: 2
# Cop supports --auto-correct.
TrailingBlankLines:
Enabled: false

# Offence count: 27
# Cop supports --auto-correct.
TrailingWhitespace:
Enabled: false

# Offence count: 12
UselessAssignment:
Enabled: false

# Offence count: 5
# Configuration parameters: IncludePaths.
Validation:
Enabled: false

# Offence count: 2
# Cop supports --auto-correct.
WordArray:
MinSize: 2

0 comments on commit c00a3c4

Please sign in to comment.