maximus 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +66 -0
- data/Rakefile +2 -0
- data/bin/maximus +15 -0
- data/lib/maximus.rb +25 -0
- data/lib/maximus/cli.rb +106 -0
- data/lib/maximus/config/.jshintignore +2 -0
- data/lib/maximus/config/jshint.json +9 -0
- data/lib/maximus/config/phantomas.json +4 -0
- data/lib/maximus/config/phantomas_urls.yaml +1 -0
- data/lib/maximus/config/rubocop.yml +1007 -0
- data/lib/maximus/config/scsslint.yml +58 -0
- data/lib/maximus/config/stylestats.json +30 -0
- data/lib/maximus/config/wraith.yaml +56 -0
- data/lib/maximus/config/wraith/casper.js +20 -0
- data/lib/maximus/config/wraith/nojs.js +85 -0
- data/lib/maximus/config/wraith/snap.js +85 -0
- data/lib/maximus/constants.rb +3 -0
- data/lib/maximus/git_control.rb +255 -0
- data/lib/maximus/helper.rb +137 -0
- data/lib/maximus/lint.rb +201 -0
- data/lib/maximus/lints/brakeman.rb +61 -0
- data/lib/maximus/lints/jshint.rb +20 -0
- data/lib/maximus/lints/railsbp.rb +51 -0
- data/lib/maximus/lints/rubocop.rb +18 -0
- data/lib/maximus/lints/scsslint.rb +17 -0
- data/lib/maximus/rake_tasks.rb +13 -0
- data/lib/maximus/reporter/git-lines.sh +57 -0
- data/lib/maximus/reporter/jshint.js +28 -0
- data/lib/maximus/reporter/rubocop.rb +49 -0
- data/lib/maximus/statistic.rb +65 -0
- data/lib/maximus/statistics/phantomas.rb +32 -0
- data/lib/maximus/statistics/stylestats.rb +111 -0
- data/lib/maximus/statistics/wraith.rb +88 -0
- data/lib/maximus/tasks/be.rake +35 -0
- data/lib/maximus/tasks/fe.rake +30 -0
- data/lib/maximus/tasks/maximus.rake +39 -0
- data/lib/maximus/tasks/statistic.rake +26 -0
- data/lib/maximus/version.rb +3 -0
- data/maximus.gemspec +32 -0
- data/roadmap.md +17 -0
- metadata +243 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7a829426c745c7f18dc1d11d07dbd2691d200470
|
4
|
+
data.tar.gz: cc500897739970fe484063b2c1123878720597b9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0cc6838ccbba2c08ab06ab8057082dfedbfb83bc92005de584eb890b2fd6b45c4ac1d3947a40ee4bf8d1bff163a373edf3387fbaf0a3a3032c9f44c5330e201f
|
7
|
+
data.tar.gz: 2fd0310eef81b446c01334e66368de98f8bfa37687da3f348f053559dce8db08a7473ea45710ec1aa0fbfb17968fcd30aca93f47f4d9b7eff89924cbd099b8ae
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Tim Shedor
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Maximus
|
2
|
+
|
3
|
+
The all-in-one linting solution.
|
4
|
+
|
5
|
+
Plays nice with Middleman and Rails.
|
6
|
+
|
7
|
+
In the development block:
|
8
|
+
|
9
|
+
`gem 'maximus', git: 'git@bitbucket.org:wearefine/maximus.git'`
|
10
|
+
|
11
|
+
## Command Line Flags
|
12
|
+
|
13
|
+
Flag | Accepts | Description
|
14
|
+
--------------------|----------------------------------|--------------------
|
15
|
+
`-p`/`--path` | String/Array | Absolute path to URLs or files
|
16
|
+
`-f`/`--frontend` | Boolean/Blank | Run all front-end lints
|
17
|
+
`-b`/`--backend` | Boolean/Blank | Run all back-end lints
|
18
|
+
`-s`/`--statistics` | Boolean/Blank | Run all back-end lints
|
19
|
+
`-a`/`--all` | Boolean/Blank | Run all everything
|
20
|
+
`-i`/`--include` | String/Array | Include specific lints or statistics
|
21
|
+
`-i`/`--exclude` | String/Array | Exclude specific lints or statistics
|
22
|
+
`-c`/`--commit` | String/`working`/`last`/`master` |
|
23
|
+
|
24
|
+
* Lint tasks can accept glob notation, i.e. `**/*.scss`
|
25
|
+
* Arrays are space-separated, i.e. `--path=http://localhost:3000/ http://localhost:3000/about`
|
26
|
+
|
27
|
+
## Command Line Commands
|
28
|
+
|
29
|
+
Command | Description
|
30
|
+
----------------------|---------------------------
|
31
|
+
`install` | Installs node dependencies
|
32
|
+
`frontend` | Runs all front-end lints
|
33
|
+
`backend` | Runs all back-end lints
|
34
|
+
`statistics` | Runs all statistics
|
35
|
+
|
36
|
+
## Examples
|
37
|
+
|
38
|
+
Default. Lints based on your working directory
|
39
|
+
|
40
|
+
`maximus -c working`
|
41
|
+
|
42
|
+
Lints based on the previous commit by `HEAD^`
|
43
|
+
|
44
|
+
`maximus -c last`
|
45
|
+
|
46
|
+
Lints based on the commit on the master branch
|
47
|
+
|
48
|
+
`maximus -c master`
|
49
|
+
|
50
|
+
Lints based on commit d96a8e23
|
51
|
+
|
52
|
+
`maximus -c d96a8e23`
|
53
|
+
|
54
|
+
## Lint syntax
|
55
|
+
|
56
|
+
When adding new lints, the JSON output should obey the following format:
|
57
|
+
|
58
|
+
```
|
59
|
+
[ <filename String>: {
|
60
|
+
linter: <test_name String>
|
61
|
+
severity: <warning | error | convention | refactor String>
|
62
|
+
reason: <explaination String>
|
63
|
+
column: <position Integer>
|
64
|
+
line: <position Integer>
|
65
|
+
} ]
|
66
|
+
```
|
data/Rakefile
ADDED
data/bin/maximus
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Load Rails if it exists
|
4
|
+
require "#{Dir.pwd}/config/application" if File.exists?("#{Dir.pwd}/bin/rails")
|
5
|
+
|
6
|
+
begin
|
7
|
+
require 'maximus'
|
8
|
+
require 'maximus/cli'
|
9
|
+
Maximus::CLI.start
|
10
|
+
rescue Interrupt
|
11
|
+
puts "\nQuitting..."
|
12
|
+
exit 1
|
13
|
+
rescue SystemExit => e
|
14
|
+
exit e.status
|
15
|
+
end
|
data/lib/maximus.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'maximus/constants'
|
2
|
+
require 'maximus/version'
|
3
|
+
require 'maximus/helper'
|
4
|
+
require 'maximus/git_control'
|
5
|
+
require 'maximus/lint'
|
6
|
+
require 'maximus/statistic'
|
7
|
+
require 'maximus/rake_tasks'
|
8
|
+
|
9
|
+
# Get statistics
|
10
|
+
Dir[File.expand_path('maximus/statistics/*.rb', File.dirname(__FILE__))].each do |file|
|
11
|
+
require file
|
12
|
+
end
|
13
|
+
|
14
|
+
# Get lints
|
15
|
+
Dir[File.expand_path('maximus/lints/*.rb', File.dirname(__FILE__))].each do |file|
|
16
|
+
require file
|
17
|
+
end
|
18
|
+
|
19
|
+
# Rainbow color highlighting key
|
20
|
+
# Blue - System/unrelated
|
21
|
+
# Red - Error/Danger/Line Number
|
22
|
+
# Yellow - Warning
|
23
|
+
# Cyan - Filename/Convention
|
24
|
+
# White - Refactor
|
25
|
+
# Green - Success/Lint Name/Linter Name
|
data/lib/maximus/cli.rb
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
class Maximus::CLI < Thor
|
4
|
+
include Thor::Actions
|
5
|
+
class_option :path, aliases: ["-p", "-u", "\--url"], default: nil, desc: "Space-separated path(s) to URLs or files"
|
6
|
+
class_option :frontend, default: false, lazy_default: false, type: :boolean, desc: "Do front-end lints", aliases: ["-f", "--front-end"]
|
7
|
+
class_option :backend, default: false, lazy_default: false, type: :boolean, desc: "Do back-end lints", aliases: ["-b", "--back-end"]
|
8
|
+
class_option :statistics, default: false, lazy_default: false, type: :boolean, desc: "Do statistics", aliases: ["-s"]
|
9
|
+
class_option :all, default: false, lazy_default: false, type: :boolean, desc: "Do everything", aliases: ["-a"]
|
10
|
+
class_option :include, default: [], type: :array, aliases: ["-i"], desc: "Include only specific lints or statistics"
|
11
|
+
class_option :exclude, default: [], type: :array, aliases: ["-e"], desc: "Exlude specific lints or statistics"
|
12
|
+
class_option :commit, default: 'working', type: :string, banner: "working, last, master, or sha", aliases: ["-c", "--sha"], desc: "Lint by commit or working copy"
|
13
|
+
|
14
|
+
desc "frontend", "Execute all front-end tasks"
|
15
|
+
def frontend
|
16
|
+
['scsslint', 'jshint'].each { |e| check_exclude(e) }
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "backend", "Lint with all backend lints"
|
20
|
+
def backend
|
21
|
+
['rubocop', 'railsbp', 'brakeman'].each { |e| check_exclude(e) }
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "statistics", "Run all statistics"
|
25
|
+
def statistics
|
26
|
+
['stylestats', 'phantomas', 'wraith'].each { |e| check_exclude(e) }
|
27
|
+
end
|
28
|
+
|
29
|
+
# Alias ruby to backend
|
30
|
+
# (alias_method doesn't work because Thor requires a description)
|
31
|
+
desc "ruby", "Lint with all ruby lints"
|
32
|
+
def ruby
|
33
|
+
backend
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "git", "Display lint data based on working copy, last commit, master branch or specific sha"
|
37
|
+
def git
|
38
|
+
all_tasks = ['frontend', 'backend', 'statistics']
|
39
|
+
# If all flag is enabled, run everything
|
40
|
+
return all_tasks.each { |a| send(a) } if options[:all]
|
41
|
+
# Lint by category unless all flags are blank
|
42
|
+
return all_tasks.each { |a| check_option(a) } unless options[:frontend].blank? && options[:backend].blank? && options[:statistics].blank?
|
43
|
+
# If include flag is enabled, run based on what's included
|
44
|
+
return options[:include].each { |i| send(i) } unless options[:include].blank?
|
45
|
+
# If all flag is not enabled, lint working copy as it's supposed to be
|
46
|
+
return Maximus::GitControl.new({ commit: options[:commit], is_dev: true }).lints_and_stats(true)
|
47
|
+
end
|
48
|
+
|
49
|
+
# TODO - something better than just installing in the global npm file
|
50
|
+
# and including phantomjs
|
51
|
+
desc "install", "Install all dependencies"
|
52
|
+
def install
|
53
|
+
`npm install -g jshint phantomas stylestats`
|
54
|
+
end
|
55
|
+
|
56
|
+
no_commands do
|
57
|
+
# Only run command if option is present
|
58
|
+
def check_option(opt)
|
59
|
+
send(opt) if options[opt.to_sym]
|
60
|
+
end
|
61
|
+
# Don't run command if it's present in the exlude options
|
62
|
+
def check_exclude(opt)
|
63
|
+
send(opt) unless options[:exclude].include?(opt)
|
64
|
+
end
|
65
|
+
def default_options
|
66
|
+
{
|
67
|
+
path: options[:path],
|
68
|
+
is_dev: true
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
def scsslint
|
73
|
+
Maximus::Scsslint.new(default_options).result
|
74
|
+
end
|
75
|
+
|
76
|
+
def jshint
|
77
|
+
Maximus::Jshint.new(default_options).result
|
78
|
+
end
|
79
|
+
|
80
|
+
def rubocop
|
81
|
+
Maximus::Rubocop.new(default_options).result
|
82
|
+
end
|
83
|
+
|
84
|
+
def railsbp
|
85
|
+
Maximus::Railsbp.new(default_options).result
|
86
|
+
end
|
87
|
+
|
88
|
+
def brakeman
|
89
|
+
Maximus::Brakeman.new(default_options).result
|
90
|
+
end
|
91
|
+
|
92
|
+
def stylestats
|
93
|
+
Maximus::Stylestats.new(default_options).result
|
94
|
+
end
|
95
|
+
|
96
|
+
def phantomas
|
97
|
+
Maximus::Phantomas.new(default_options).result
|
98
|
+
end
|
99
|
+
|
100
|
+
def wraith
|
101
|
+
Maximus::Wraith.new(default_options).result
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
default_task :git
|
106
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
home: /
|
@@ -0,0 +1,1007 @@
|
|
1
|
+
# Common configuration.
|
2
|
+
AllCops:
|
3
|
+
# Include gemspec and Rakefile
|
4
|
+
Include:
|
5
|
+
- '**/*.gemspec'
|
6
|
+
- '**/*.podspec'
|
7
|
+
- '**/*.jbuilder'
|
8
|
+
- '**/*.rake'
|
9
|
+
- '**/*.opal'
|
10
|
+
- '**/Gemfile'
|
11
|
+
- '**/Rakefile'
|
12
|
+
- '**/Capfile'
|
13
|
+
- '**/Guardfile'
|
14
|
+
- '**/Podfile'
|
15
|
+
- '**/Thorfile'
|
16
|
+
- '**/Vagrantfile'
|
17
|
+
- '**/Berksfile'
|
18
|
+
- '**/Cheffile'
|
19
|
+
- '**/Vagabondfile'
|
20
|
+
Exclude:
|
21
|
+
- 'vendor/**/*'
|
22
|
+
# By default, the rails cops are not run. Override in project or home
|
23
|
+
# directory .rubocop.yml files, or by giving the -R/--rails option.
|
24
|
+
RunRailsCops: true
|
25
|
+
|
26
|
+
|
27
|
+
# These are all the cops that are enabled in the default configuration.
|
28
|
+
|
29
|
+
Style/AccessModifierIndentation:
|
30
|
+
Description: Check indentation of private/protected visibility modifiers.
|
31
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
|
32
|
+
Enabled: true
|
33
|
+
|
34
|
+
Style/AccessorMethodName:
|
35
|
+
Description: Check the naming of accessor methods for get_/set_.
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Style/Alias:
|
39
|
+
Description: 'Use alias_method instead of alias.'
|
40
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Style/AlignArray:
|
44
|
+
Description: >-
|
45
|
+
Align the elements of an array literal if they span more than
|
46
|
+
one line.
|
47
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
|
48
|
+
Enabled: true
|
49
|
+
|
50
|
+
Style/AlignHash:
|
51
|
+
Description: >-
|
52
|
+
Align the elements of a hash literal if they span more than
|
53
|
+
one line.
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Style/AlignParameters:
|
57
|
+
Description: >-
|
58
|
+
Align the parameters of a method call if they span more
|
59
|
+
than one line.
|
60
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Style/AndOr:
|
64
|
+
Description: 'Use &&/|| instead of and/or.'
|
65
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
|
66
|
+
Enabled: true
|
67
|
+
|
68
|
+
Style/ArrayJoin:
|
69
|
+
Description: 'Use Array#join instead of Array#*.'
|
70
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
Style/AsciiComments:
|
74
|
+
Description: 'Use only ascii symbols in comments.'
|
75
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
76
|
+
Enabled: true
|
77
|
+
|
78
|
+
Style/AsciiIdentifiers:
|
79
|
+
Description: 'Use only ascii symbols in identifiers.'
|
80
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
81
|
+
Enabled: true
|
82
|
+
|
83
|
+
Style/Attr:
|
84
|
+
Description: 'Checks for uses of Module#attr.'
|
85
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
86
|
+
Enabled: true
|
87
|
+
|
88
|
+
Style/BeginBlock:
|
89
|
+
Description: 'Avoid the use of BEGIN blocks.'
|
90
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
|
91
|
+
Enabled: true
|
92
|
+
|
93
|
+
Style/BarePercentLiterals:
|
94
|
+
Description: 'Checks if usage of %() or %Q() matches configuration.'
|
95
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
|
96
|
+
Enabled: true
|
97
|
+
|
98
|
+
Style/BlockComments:
|
99
|
+
Description: 'Do not use block comments.'
|
100
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
|
101
|
+
Enabled: true
|
102
|
+
|
103
|
+
Style/BlockEndNewline:
|
104
|
+
Description: 'Put end statement of multiline block on its own line.'
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
Style/Blocks:
|
108
|
+
Description: >-
|
109
|
+
Avoid using {...} for multi-line blocks (multiline chaining is
|
110
|
+
always ugly).
|
111
|
+
Prefer {...} over do...end for single-line blocks.
|
112
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
113
|
+
Enabled: true
|
114
|
+
|
115
|
+
Style/BracesAroundHashParameters:
|
116
|
+
Description: 'Enforce braces style around hash parameters.'
|
117
|
+
Enabled: true
|
118
|
+
|
119
|
+
Style/CaseEquality:
|
120
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
121
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
122
|
+
Enabled: true
|
123
|
+
|
124
|
+
Style/CaseIndentation:
|
125
|
+
Description: 'Indentation of when in a case/when/[else/]end.'
|
126
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
|
127
|
+
Enabled: true
|
128
|
+
|
129
|
+
Style/CharacterLiteral:
|
130
|
+
Description: 'Checks for uses of character literals.'
|
131
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
132
|
+
Enabled: true
|
133
|
+
|
134
|
+
Style/ClassAndModuleCamelCase:
|
135
|
+
Description: 'Use CamelCase for classes and modules.'
|
136
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
|
137
|
+
Enabled: true
|
138
|
+
|
139
|
+
Style/ClassAndModuleChildren:
|
140
|
+
Description: 'Checks style of children classes and modules.'
|
141
|
+
Enabled: true
|
142
|
+
|
143
|
+
Style/ClassCheck:
|
144
|
+
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
145
|
+
Enabled: true
|
146
|
+
|
147
|
+
Style/ClassMethods:
|
148
|
+
Description: 'Use self when defining module/class methods.'
|
149
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-singletons'
|
150
|
+
Enabled: true
|
151
|
+
|
152
|
+
Style/ClassVars:
|
153
|
+
Description: 'Avoid the use of class variables.'
|
154
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
155
|
+
Enabled: true
|
156
|
+
|
157
|
+
Style/ColonMethodCall:
|
158
|
+
Description: 'Do not use :: for method call.'
|
159
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
160
|
+
Enabled: true
|
161
|
+
|
162
|
+
Style/CommentAnnotation:
|
163
|
+
Description: >-
|
164
|
+
Checks formatting of special comments
|
165
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
166
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
167
|
+
Enabled: true
|
168
|
+
|
169
|
+
Style/CommentIndentation:
|
170
|
+
Description: 'Indentation of comments.'
|
171
|
+
Enabled: true
|
172
|
+
|
173
|
+
Style/ConstantName:
|
174
|
+
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
175
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
|
176
|
+
Enabled: true
|
177
|
+
|
178
|
+
Style/DefWithParentheses:
|
179
|
+
Description: 'Use def with parentheses when there are arguments.'
|
180
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
181
|
+
Enabled: true
|
182
|
+
|
183
|
+
Style/DeprecatedHashMethods:
|
184
|
+
Description: 'Checks for use of deprecated Hash methods.'
|
185
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
|
186
|
+
Enabled: true
|
187
|
+
|
188
|
+
Style/Documentation:
|
189
|
+
Description: 'Document classes and non-namespace modules.'
|
190
|
+
Enabled: false
|
191
|
+
|
192
|
+
Style/DotPosition:
|
193
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
194
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
195
|
+
Enabled: true
|
196
|
+
|
197
|
+
Style/DoubleNegation:
|
198
|
+
Description: 'Checks for uses of double negation (!!).'
|
199
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
200
|
+
Enabled: true
|
201
|
+
|
202
|
+
Style/EachWithObject:
|
203
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
204
|
+
Enabled: true
|
205
|
+
|
206
|
+
Style/ElseAlignment:
|
207
|
+
Description: 'Align elses and elsifs correctly.'
|
208
|
+
Enabled: true
|
209
|
+
|
210
|
+
Style/EmptyLineBetweenDefs:
|
211
|
+
Description: 'Use empty lines between defs.'
|
212
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
|
213
|
+
Enabled: true
|
214
|
+
|
215
|
+
Style/EmptyLines:
|
216
|
+
Description: "Don't use several empty lines in a row."
|
217
|
+
Enabled: true
|
218
|
+
|
219
|
+
Style/EmptyLinesAroundAccessModifier:
|
220
|
+
Description: "Keep blank lines around access modifiers."
|
221
|
+
Enabled: true
|
222
|
+
|
223
|
+
Style/EmptyLinesAroundClassBody:
|
224
|
+
Description: "Keeps track of empty lines around class bodies."
|
225
|
+
Enabled: true
|
226
|
+
|
227
|
+
Style/EmptyLinesAroundModuleBody:
|
228
|
+
Description: "Keeps track of empty lines around module bodies."
|
229
|
+
Enabled: true
|
230
|
+
|
231
|
+
Style/EmptyLinesAroundMethodBody:
|
232
|
+
Description: "Keeps track of empty lines around method bodies."
|
233
|
+
Enabled: true
|
234
|
+
|
235
|
+
Style/EmptyLiteral:
|
236
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
237
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
238
|
+
Enabled: true
|
239
|
+
|
240
|
+
Style/EndBlock:
|
241
|
+
Description: 'Avoid the use of END blocks.'
|
242
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
|
243
|
+
Enabled: true
|
244
|
+
|
245
|
+
Style/EndOfLine:
|
246
|
+
Description: 'Use Unix-style line endings.'
|
247
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
|
248
|
+
Enabled: true
|
249
|
+
|
250
|
+
Style/EvenOdd:
|
251
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
252
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
253
|
+
Enabled: true
|
254
|
+
|
255
|
+
Style/FileName:
|
256
|
+
Description: 'Use snake_case for source file names.'
|
257
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
258
|
+
Enabled: true
|
259
|
+
|
260
|
+
Style/FlipFlop:
|
261
|
+
Description: 'Checks for flip flops'
|
262
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
263
|
+
Enabled: true
|
264
|
+
|
265
|
+
Style/For:
|
266
|
+
Description: 'Checks use of for or each in multiline loops.'
|
267
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
|
268
|
+
Enabled: true
|
269
|
+
|
270
|
+
Style/FormatString:
|
271
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
272
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
273
|
+
Enabled: true
|
274
|
+
|
275
|
+
Style/GlobalVars:
|
276
|
+
Description: 'Do not introduce global variables.'
|
277
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
278
|
+
Enabled: true
|
279
|
+
|
280
|
+
Style/GuardClause:
|
281
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
282
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
283
|
+
Enabled: true
|
284
|
+
|
285
|
+
Style/HashSyntax:
|
286
|
+
Description: >-
|
287
|
+
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
288
|
+
{ :a => 1, :b => 2 }.
|
289
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
|
290
|
+
Enabled: true
|
291
|
+
|
292
|
+
Style/IfUnlessModifier:
|
293
|
+
Description: >-
|
294
|
+
Favor modifier if/unless usage when you have a
|
295
|
+
single-line body.
|
296
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
297
|
+
Enabled: true
|
298
|
+
|
299
|
+
Style/IfWithSemicolon:
|
300
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
301
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
302
|
+
Enabled: true
|
303
|
+
|
304
|
+
Style/IndentationConsistency:
|
305
|
+
Description: 'Keep indentation straight.'
|
306
|
+
Enabled: true
|
307
|
+
|
308
|
+
Style/IndentationWidth:
|
309
|
+
Description: 'Use 2 spaces for indentation.'
|
310
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
311
|
+
Enabled: true
|
312
|
+
|
313
|
+
Style/IndentArray:
|
314
|
+
Description: >-
|
315
|
+
Checks the indentation of the first element in an array
|
316
|
+
literal.
|
317
|
+
Enabled: true
|
318
|
+
|
319
|
+
Style/IndentHash:
|
320
|
+
Description: 'Checks the indentation of the first key in a hash literal.'
|
321
|
+
Enabled: true
|
322
|
+
|
323
|
+
Style/InfiniteLoop:
|
324
|
+
Description: 'Use Kernel#loop for infinite loops.'
|
325
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
|
326
|
+
Enabled: true
|
327
|
+
|
328
|
+
Style/Lambda:
|
329
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
330
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
331
|
+
Enabled: true
|
332
|
+
|
333
|
+
Style/LambdaCall:
|
334
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
335
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
336
|
+
Enabled: true
|
337
|
+
|
338
|
+
Style/LeadingCommentSpace:
|
339
|
+
Description: 'Comments should start with a space.'
|
340
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
|
341
|
+
Enabled: true
|
342
|
+
|
343
|
+
Style/LineEndConcatenation:
|
344
|
+
Description: >-
|
345
|
+
Use \ instead of + or << to concatenate two string literals at
|
346
|
+
line end.
|
347
|
+
Enabled: true
|
348
|
+
|
349
|
+
Style/MethodCallParentheses:
|
350
|
+
Description: 'Do not use parentheses for method calls with no arguments.'
|
351
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
|
352
|
+
Enabled: true
|
353
|
+
|
354
|
+
Style/MethodDefParentheses:
|
355
|
+
Description: >-
|
356
|
+
Checks if the method definitions have or don't have
|
357
|
+
parentheses.
|
358
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
359
|
+
Enabled: true
|
360
|
+
|
361
|
+
Style/MethodName:
|
362
|
+
Description: 'Use the configured style when naming methods.'
|
363
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
364
|
+
Enabled: true
|
365
|
+
|
366
|
+
Style/ModuleFunction:
|
367
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
368
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
369
|
+
Enabled: true
|
370
|
+
|
371
|
+
Style/MultilineBlockChain:
|
372
|
+
Description: 'Avoid multi-line chains of blocks.'
|
373
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
374
|
+
Enabled: true
|
375
|
+
|
376
|
+
Style/MultilineBlockLayout:
|
377
|
+
Description: 'Ensures newlines after multiline block do statements.'
|
378
|
+
Enabled: true
|
379
|
+
|
380
|
+
Style/MultilineIfThen:
|
381
|
+
Description: 'Do not use then for multi-line if/unless.'
|
382
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
|
383
|
+
Enabled: true
|
384
|
+
|
385
|
+
Style/MultilineOperationIndentation:
|
386
|
+
Description: >-
|
387
|
+
Checks indentation of binary operations that span more than
|
388
|
+
one line.
|
389
|
+
Enabled: true
|
390
|
+
|
391
|
+
Style/MultilineTernaryOperator:
|
392
|
+
Description: >-
|
393
|
+
Avoid multi-line ?: (the ternary operator);
|
394
|
+
use if/unless instead.
|
395
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
|
396
|
+
Enabled: true
|
397
|
+
|
398
|
+
Style/NegatedIf:
|
399
|
+
Description: >-
|
400
|
+
Favor unless over if for negative conditions
|
401
|
+
(or control flow or).
|
402
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
403
|
+
Enabled: true
|
404
|
+
|
405
|
+
Style/NegatedWhile:
|
406
|
+
Description: 'Favor until over while for negative conditions.'
|
407
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
408
|
+
Enabled: true
|
409
|
+
|
410
|
+
Style/NestedTernaryOperator:
|
411
|
+
Description: 'Use one expression per branch in a ternary operator.'
|
412
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
|
413
|
+
Enabled: true
|
414
|
+
|
415
|
+
Style/Next:
|
416
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
417
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
418
|
+
Enabled: true
|
419
|
+
|
420
|
+
Style/NilComparison:
|
421
|
+
Description: 'Prefer x.nil? to x == nil.'
|
422
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
423
|
+
Enabled: true
|
424
|
+
|
425
|
+
Style/NonNilCheck:
|
426
|
+
Description: 'Checks for redundant nil checks.'
|
427
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
|
428
|
+
Enabled: true
|
429
|
+
|
430
|
+
Style/Not:
|
431
|
+
Description: 'Use ! instead of not.'
|
432
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
433
|
+
Enabled: true
|
434
|
+
|
435
|
+
Style/NumericLiterals:
|
436
|
+
Description: >-
|
437
|
+
Add underscores to large numeric literals to improve their
|
438
|
+
readability.
|
439
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
440
|
+
Enabled: true
|
441
|
+
|
442
|
+
Style/OneLineConditional:
|
443
|
+
Description: >-
|
444
|
+
Favor the ternary operator(?:) over
|
445
|
+
if/then/else/end constructs.
|
446
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
447
|
+
Enabled: true
|
448
|
+
|
449
|
+
Style/OpMethod:
|
450
|
+
Description: 'When defining binary operators, name the argument other.'
|
451
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
452
|
+
Enabled: true
|
453
|
+
|
454
|
+
Style/ParenthesesAroundCondition:
|
455
|
+
Description: >-
|
456
|
+
Don't use parentheses around the condition of an
|
457
|
+
if/unless/while.
|
458
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
|
459
|
+
Enabled: true
|
460
|
+
|
461
|
+
Style/PercentLiteralDelimiters:
|
462
|
+
Description: 'Use `%`-literal delimiters consistently'
|
463
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
464
|
+
Enabled: true
|
465
|
+
|
466
|
+
Style/PercentQLiterals:
|
467
|
+
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
468
|
+
Enabled: true
|
469
|
+
|
470
|
+
Style/PerlBackrefs:
|
471
|
+
Description: 'Avoid Perl-style regex back references.'
|
472
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
473
|
+
Enabled: true
|
474
|
+
|
475
|
+
Style/PredicateName:
|
476
|
+
Description: 'Check the names of predicate methods.'
|
477
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
478
|
+
Enabled: true
|
479
|
+
|
480
|
+
Style/Proc:
|
481
|
+
Description: 'Use proc instead of Proc.new.'
|
482
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
483
|
+
Enabled: true
|
484
|
+
|
485
|
+
Style/RaiseArgs:
|
486
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
487
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
488
|
+
Enabled: true
|
489
|
+
|
490
|
+
Style/RedundantBegin:
|
491
|
+
Description: "Don't use begin blocks when they are not needed."
|
492
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
|
493
|
+
Enabled: true
|
494
|
+
|
495
|
+
Style/RedundantException:
|
496
|
+
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
497
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
|
498
|
+
Enabled: true
|
499
|
+
|
500
|
+
Style/RedundantReturn:
|
501
|
+
Description: "Don't use return where it's not required."
|
502
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
|
503
|
+
Enabled: true
|
504
|
+
|
505
|
+
Style/RedundantSelf:
|
506
|
+
Description: "Don't use self where it's not needed."
|
507
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
|
508
|
+
Enabled: true
|
509
|
+
|
510
|
+
Style/RegexpLiteral:
|
511
|
+
Description: >-
|
512
|
+
Use %r for regular expressions matching more than
|
513
|
+
`MaxSlashes` '/' characters.
|
514
|
+
Use %r only for regular expressions matching more than
|
515
|
+
`MaxSlashes` '/' character.
|
516
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
517
|
+
Enabled: true
|
518
|
+
|
519
|
+
Style/RescueModifier:
|
520
|
+
Description: 'Avoid using rescue in its modifier form.'
|
521
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
|
522
|
+
Enabled: true
|
523
|
+
|
524
|
+
Style/SelfAssignment:
|
525
|
+
Description: >-
|
526
|
+
Checks for places where self-assignment shorthand should have
|
527
|
+
been used.
|
528
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
529
|
+
Enabled: true
|
530
|
+
|
531
|
+
Style/Semicolon:
|
532
|
+
Description: "Don't use semicolons to terminate expressions."
|
533
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
|
534
|
+
Enabled: true
|
535
|
+
|
536
|
+
Style/SignalException:
|
537
|
+
Description: 'Checks for proper usage of fail and raise.'
|
538
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
539
|
+
Enabled: true
|
540
|
+
|
541
|
+
Style/SingleLineBlockParams:
|
542
|
+
Description: 'Enforces the names of some block params.'
|
543
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
544
|
+
Enabled: true
|
545
|
+
|
546
|
+
Style/SingleLineMethods:
|
547
|
+
Description: 'Avoid single-line methods.'
|
548
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
549
|
+
Enabled: true
|
550
|
+
|
551
|
+
Style/SingleSpaceBeforeFirstArg:
|
552
|
+
Description: >-
|
553
|
+
Checks that exactly one space is used between a method name
|
554
|
+
and the first argument for method calls without parentheses.
|
555
|
+
Enabled: true
|
556
|
+
|
557
|
+
Style/SpaceAfterColon:
|
558
|
+
Description: 'Use spaces after colons.'
|
559
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
560
|
+
Enabled: true
|
561
|
+
|
562
|
+
Style/SpaceAfterComma:
|
563
|
+
Description: 'Use spaces after commas.'
|
564
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
565
|
+
Enabled: true
|
566
|
+
|
567
|
+
Style/SpaceAfterControlKeyword:
|
568
|
+
Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
|
569
|
+
Enabled: true
|
570
|
+
|
571
|
+
Style/SpaceAfterMethodName:
|
572
|
+
Description: >-
|
573
|
+
Do not put a space between a method name and the opening
|
574
|
+
parenthesis in a method definition.
|
575
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
576
|
+
Enabled: true
|
577
|
+
|
578
|
+
Style/SpaceAfterNot:
|
579
|
+
Description: Tracks redundant space after the ! operator.
|
580
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
|
581
|
+
Enabled: true
|
582
|
+
|
583
|
+
Style/SpaceAfterSemicolon:
|
584
|
+
Description: 'Use spaces after semicolons.'
|
585
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
586
|
+
Enabled: true
|
587
|
+
|
588
|
+
Style/SpaceBeforeBlockBraces:
|
589
|
+
Description: >-
|
590
|
+
Checks that the left block brace has or doesn't have space
|
591
|
+
before it.
|
592
|
+
Enabled: true
|
593
|
+
|
594
|
+
Style/SpaceBeforeComma:
|
595
|
+
Description: 'No spaces before commas.'
|
596
|
+
Enabled: true
|
597
|
+
|
598
|
+
Style/SpaceBeforeComment:
|
599
|
+
Description: >-
|
600
|
+
Checks for missing space between code and a comment on the
|
601
|
+
same line.
|
602
|
+
Enabled: true
|
603
|
+
|
604
|
+
Style/SpaceBeforeSemicolon:
|
605
|
+
Description: 'No spaces before semicolons.'
|
606
|
+
Enabled: true
|
607
|
+
|
608
|
+
Style/SpaceInsideBlockBraces:
|
609
|
+
Description: >-
|
610
|
+
Checks that block braces have or don't have surrounding space.
|
611
|
+
For blocks taking parameters, checks that the left brace has
|
612
|
+
or doesn't have trailing space.
|
613
|
+
Enabled: true
|
614
|
+
|
615
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
616
|
+
Description: >-
|
617
|
+
Checks that the equals signs in parameter default assignments
|
618
|
+
have or don't have surrounding space depending on
|
619
|
+
configuration.
|
620
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
|
621
|
+
Enabled: true
|
622
|
+
|
623
|
+
Style/SpaceAroundOperators:
|
624
|
+
Description: 'Use spaces around operators.'
|
625
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
626
|
+
Enabled: true
|
627
|
+
|
628
|
+
Style/SpaceBeforeModifierKeyword:
|
629
|
+
Description: 'Put a space before the modifier keyword.'
|
630
|
+
Enabled: true
|
631
|
+
|
632
|
+
Style/SpaceInsideBrackets:
|
633
|
+
Description: 'No spaces after [ or before ].'
|
634
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
635
|
+
Enabled: true
|
636
|
+
|
637
|
+
Style/SpaceInsideHashLiteralBraces:
|
638
|
+
Description: "Use spaces inside hash literal braces - or don't."
|
639
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
640
|
+
Enabled: true
|
641
|
+
|
642
|
+
Style/SpaceInsideParens:
|
643
|
+
Description: 'No spaces after ( or before ).'
|
644
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
645
|
+
Enabled: true
|
646
|
+
|
647
|
+
Style/SpaceInsideRangeLiteral:
|
648
|
+
Description: 'No spaces inside range literals.'
|
649
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
|
650
|
+
Enabled: true
|
651
|
+
|
652
|
+
Style/SpecialGlobalVars:
|
653
|
+
Description: 'Avoid Perl-style global variables.'
|
654
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
655
|
+
Enabled: true
|
656
|
+
|
657
|
+
Style/StringLiterals:
|
658
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
659
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
660
|
+
Enabled: true
|
661
|
+
|
662
|
+
Style/StringLiteralsInInterpolation:
|
663
|
+
Description: >-
|
664
|
+
Checks if uses of quotes inside expressions in interpolated
|
665
|
+
strings match the configured preference.
|
666
|
+
Enabled: true
|
667
|
+
|
668
|
+
Style/SymbolProc:
|
669
|
+
Description: 'Use symbols as procs instead of blocks when possible.'
|
670
|
+
Enabled: true
|
671
|
+
|
672
|
+
Style/Tab:
|
673
|
+
Description: 'No hard tabs.'
|
674
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
675
|
+
Enabled: true
|
676
|
+
|
677
|
+
Style/TrailingBlankLines:
|
678
|
+
Description: 'Checks trailing blank lines and final newline.'
|
679
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
|
680
|
+
Enabled: true
|
681
|
+
|
682
|
+
Style/TrailingComma:
|
683
|
+
Description: 'Checks for trailing comma in parameter lists and literals.'
|
684
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
685
|
+
Enabled: true
|
686
|
+
|
687
|
+
Style/TrailingWhitespace:
|
688
|
+
Description: 'Avoid trailing whitespace.'
|
689
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
|
690
|
+
Enabled: true
|
691
|
+
|
692
|
+
Style/TrivialAccessors:
|
693
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
694
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
695
|
+
Enabled: true
|
696
|
+
|
697
|
+
Style/UnlessElse:
|
698
|
+
Description: >-
|
699
|
+
Do not use unless with else. Rewrite these with the positive
|
700
|
+
case first.
|
701
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
|
702
|
+
Enabled: true
|
703
|
+
|
704
|
+
Style/UnneededCapitalW:
|
705
|
+
Description: 'Checks for %W when interpolation is not needed.'
|
706
|
+
Enabled: true
|
707
|
+
|
708
|
+
Style/UnneededPercentQ:
|
709
|
+
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
710
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
|
711
|
+
Enabled: true
|
712
|
+
|
713
|
+
Style/UnneededPercentX:
|
714
|
+
Description: 'Checks for %x when `` would do.'
|
715
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
|
716
|
+
Enabled: true
|
717
|
+
|
718
|
+
Style/VariableInterpolation:
|
719
|
+
Description: >-
|
720
|
+
Don't interpolate global, instance and class variables
|
721
|
+
directly in strings.
|
722
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
723
|
+
Enabled: true
|
724
|
+
|
725
|
+
Style/VariableName:
|
726
|
+
Description: 'Use the configured style when naming variables.'
|
727
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
728
|
+
Enabled: true
|
729
|
+
|
730
|
+
Style/WhenThen:
|
731
|
+
Description: 'Use when x then ... for one-line cases.'
|
732
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
733
|
+
Enabled: true
|
734
|
+
|
735
|
+
Style/WhileUntilDo:
|
736
|
+
Description: 'Checks for redundant do after while or until.'
|
737
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
|
738
|
+
Enabled: true
|
739
|
+
|
740
|
+
Style/WhileUntilModifier:
|
741
|
+
Description: >-
|
742
|
+
Favor modifier while/until usage when you have a
|
743
|
+
single-line body.
|
744
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
745
|
+
Enabled: true
|
746
|
+
|
747
|
+
Style/WordArray:
|
748
|
+
Description: 'Use %w or %W for arrays of words.'
|
749
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
750
|
+
Enabled: true
|
751
|
+
|
752
|
+
#################### Metrics ################################
|
753
|
+
|
754
|
+
Metrics/AbcSize:
|
755
|
+
Description: >-
|
756
|
+
A calculated magnitude based on number of assignments,
|
757
|
+
branches, and conditions.
|
758
|
+
Enabled: true
|
759
|
+
|
760
|
+
Metrics/BlockNesting:
|
761
|
+
Description: 'Avoid excessive block nesting'
|
762
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
763
|
+
Enabled: true
|
764
|
+
|
765
|
+
Metrics/ClassLength:
|
766
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
767
|
+
Enabled: true
|
768
|
+
|
769
|
+
Metrics/CyclomaticComplexity:
|
770
|
+
Description: >-
|
771
|
+
A complexity metric that is strongy correlated to the number
|
772
|
+
of test cases needed to validate a method.
|
773
|
+
Enabled: true
|
774
|
+
|
775
|
+
Metrics/LineLength:
|
776
|
+
Description: 'Limit lines to 80 characters.'
|
777
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
778
|
+
Enabled: true
|
779
|
+
|
780
|
+
Metrics/MethodLength:
|
781
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
782
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
783
|
+
Enabled: true
|
784
|
+
|
785
|
+
Metrics/ParameterLists:
|
786
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
787
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
788
|
+
Enabled: true
|
789
|
+
|
790
|
+
Metrics/PerceivedComplexity:
|
791
|
+
Description: >-
|
792
|
+
A complexity metric geared towards measuring complexity for a
|
793
|
+
human reader.
|
794
|
+
Enabled: true
|
795
|
+
|
796
|
+
#################### Lint ################################
|
797
|
+
### Warnings
|
798
|
+
|
799
|
+
Lint/AmbiguousOperator:
|
800
|
+
Description: >-
|
801
|
+
Checks for ambiguous operators in the first argument of a
|
802
|
+
method invocation without parentheses.
|
803
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
804
|
+
Enabled: true
|
805
|
+
|
806
|
+
Lint/AmbiguousRegexpLiteral:
|
807
|
+
Description: >-
|
808
|
+
Checks for ambiguous regexp literals in the first argument of
|
809
|
+
a method invocation without parenthesis.
|
810
|
+
Enabled: true
|
811
|
+
|
812
|
+
Lint/AssignmentInCondition:
|
813
|
+
Description: "Don't use assignment in conditions."
|
814
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
815
|
+
Enabled: true
|
816
|
+
|
817
|
+
Lint/BlockAlignment:
|
818
|
+
Description: 'Align block ends correctly.'
|
819
|
+
Enabled: true
|
820
|
+
|
821
|
+
Lint/ConditionPosition:
|
822
|
+
Description: >-
|
823
|
+
Checks for condition placed in a confusing position relative to
|
824
|
+
the keyword.
|
825
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
826
|
+
Enabled: true
|
827
|
+
|
828
|
+
Lint/Debugger:
|
829
|
+
Description: 'Check for debugger calls.'
|
830
|
+
Enabled: true
|
831
|
+
|
832
|
+
Lint/DefEndAlignment:
|
833
|
+
Description: 'Align ends corresponding to defs correctly.'
|
834
|
+
Enabled: true
|
835
|
+
|
836
|
+
Lint/DeprecatedClassMethods:
|
837
|
+
Description: 'Check for deprecated class method calls.'
|
838
|
+
Enabled: true
|
839
|
+
|
840
|
+
Lint/ElseLayout:
|
841
|
+
Description: 'Check for odd code arrangement in an else block.'
|
842
|
+
Enabled: true
|
843
|
+
|
844
|
+
Lint/EmptyEnsure:
|
845
|
+
Description: 'Checks for empty ensure block.'
|
846
|
+
Enabled: true
|
847
|
+
|
848
|
+
Lint/EmptyInterpolation:
|
849
|
+
Description: 'Checks for empty string interpolation.'
|
850
|
+
Enabled: true
|
851
|
+
|
852
|
+
Lint/EndAlignment:
|
853
|
+
Description: 'Align ends correctly.'
|
854
|
+
Enabled: true
|
855
|
+
|
856
|
+
Lint/EndInMethod:
|
857
|
+
Description: 'END blocks should not be placed inside method definitions.'
|
858
|
+
Enabled: true
|
859
|
+
|
860
|
+
Lint/EnsureReturn:
|
861
|
+
Description: 'Do not use return in an ensure block.'
|
862
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
|
863
|
+
Enabled: true
|
864
|
+
|
865
|
+
Lint/Eval:
|
866
|
+
Description: 'The use of eval represents a serious security risk.'
|
867
|
+
Enabled: true
|
868
|
+
|
869
|
+
Lint/HandleExceptions:
|
870
|
+
Description: "Don't suppress exception."
|
871
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
872
|
+
Enabled: true
|
873
|
+
|
874
|
+
Lint/InvalidCharacterLiteral:
|
875
|
+
Description: >-
|
876
|
+
Checks for invalid character literals with a non-escaped
|
877
|
+
whitespace character.
|
878
|
+
Enabled: true
|
879
|
+
|
880
|
+
Lint/LiteralInCondition:
|
881
|
+
Description: 'Checks of literals used in conditions.'
|
882
|
+
Enabled: true
|
883
|
+
|
884
|
+
Lint/LiteralInInterpolation:
|
885
|
+
Description: 'Checks for literals used in interpolation.'
|
886
|
+
Enabled: true
|
887
|
+
|
888
|
+
Lint/Loop:
|
889
|
+
Description: >-
|
890
|
+
Use Kernel#loop with break rather than begin/end/until or
|
891
|
+
begin/end/while for post-loop tests.
|
892
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
893
|
+
Enabled: true
|
894
|
+
|
895
|
+
Lint/ParenthesesAsGroupedExpression:
|
896
|
+
Description: >-
|
897
|
+
Checks for method calls with a space before the opening
|
898
|
+
parenthesis.
|
899
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
900
|
+
Enabled: true
|
901
|
+
|
902
|
+
Lint/RequireParentheses:
|
903
|
+
Description: >-
|
904
|
+
Use parentheses in the method call to avoid confusion
|
905
|
+
about precedence.
|
906
|
+
Enabled: true
|
907
|
+
|
908
|
+
Lint/RescueException:
|
909
|
+
Description: 'Avoid rescuing the Exception class.'
|
910
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
|
911
|
+
Enabled: true
|
912
|
+
|
913
|
+
Lint/ShadowingOuterLocalVariable:
|
914
|
+
Description: >-
|
915
|
+
Do not use the same name as outer local variable
|
916
|
+
for block arguments or block local variables.
|
917
|
+
Enabled: true
|
918
|
+
|
919
|
+
Lint/SpaceBeforeFirstArg:
|
920
|
+
Description: >-
|
921
|
+
Put a space between a method name and the first argument
|
922
|
+
in a method call without parentheses.
|
923
|
+
Enabled: true
|
924
|
+
|
925
|
+
Lint/StringConversionInInterpolation:
|
926
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
927
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
|
928
|
+
Enabled: true
|
929
|
+
|
930
|
+
Lint/UnderscorePrefixedVariableName:
|
931
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
932
|
+
Enabled: true
|
933
|
+
|
934
|
+
Lint/UnusedBlockArgument:
|
935
|
+
Description: 'Checks for unused block arguments.'
|
936
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
937
|
+
Enabled: true
|
938
|
+
|
939
|
+
Lint/UnusedMethodArgument:
|
940
|
+
Description: 'Checks for unused method arguments.'
|
941
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
942
|
+
Enabled: true
|
943
|
+
|
944
|
+
Lint/UnreachableCode:
|
945
|
+
Description: 'Unreachable code.'
|
946
|
+
Enabled: true
|
947
|
+
|
948
|
+
Lint/UselessAccessModifier:
|
949
|
+
Description: 'Checks for useless access modifiers.'
|
950
|
+
Enabled: true
|
951
|
+
|
952
|
+
Lint/UselessAssignment:
|
953
|
+
Description: 'Checks for useless assignment to a local variable.'
|
954
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
955
|
+
Enabled: true
|
956
|
+
|
957
|
+
Lint/UselessComparison:
|
958
|
+
Description: 'Checks for comparison of something with itself.'
|
959
|
+
Enabled: true
|
960
|
+
|
961
|
+
Lint/UselessElseWithoutRescue:
|
962
|
+
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
963
|
+
Enabled: true
|
964
|
+
|
965
|
+
Lint/UselessSetterCall:
|
966
|
+
Description: 'Checks for useless setter call to a local variable.'
|
967
|
+
Enabled: true
|
968
|
+
|
969
|
+
Lint/Void:
|
970
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
971
|
+
Enabled: true
|
972
|
+
|
973
|
+
##################### Rails ##################################
|
974
|
+
|
975
|
+
Rails/ActionFilter:
|
976
|
+
Description: 'Enforces consistent use of action filter methods.'
|
977
|
+
Enabled: true
|
978
|
+
|
979
|
+
Rails/DefaultScope:
|
980
|
+
Description: 'Checks if the argument passed to default_scope is a block.'
|
981
|
+
Enabled: true
|
982
|
+
|
983
|
+
Rails/Delegate:
|
984
|
+
Description: 'Prefer delegate method for delegations.'
|
985
|
+
Enabled: true
|
986
|
+
|
987
|
+
Rails/HasAndBelongsToMany:
|
988
|
+
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
989
|
+
Enabled: true
|
990
|
+
|
991
|
+
Rails/Output:
|
992
|
+
Description: 'Checks for calls to puts, print, etc.'
|
993
|
+
Enabled: true
|
994
|
+
|
995
|
+
Rails/ReadWriteAttribute:
|
996
|
+
Description: >-
|
997
|
+
Checks for read_attribute(:attr) and
|
998
|
+
write_attribute(:attr, val).
|
999
|
+
Enabled: true
|
1000
|
+
|
1001
|
+
Rails/ScopeArgs:
|
1002
|
+
Description: 'Checks the arguments of ActiveRecord scopes.'
|
1003
|
+
Enabled: true
|
1004
|
+
|
1005
|
+
Rails/Validation:
|
1006
|
+
Description: 'Use validates :attribute, hash of validations.'
|
1007
|
+
Enabled: true
|