best_practice_project 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +89 -23
- data/.ruby-version +1 -0
- data/Gemfile +10 -5
- data/Gemfile.lock +84 -56
- data/Rakefile +6 -24
- data/VERSION +1 -1
- data/best_practice_project.gemspec +42 -35
- data/lib/best_practice_project.rb +1 -2
- data/lib/best_practice_project/coffee_lint_handler.rb +1 -1
- data/lib/best_practice_project/config/rails_best_practices.yml +49 -0
- data/lib/best_practice_project/config/rubocop.yml +91 -23
- data/lib/best_practice_project/rubocop_handler.rb +0 -1
- data/lib/best_practice_project/scss_lint_handler.rb +1 -0
- data/lib/tasks/best_practice_project.rake +1 -1
- data/peak_flow.yml +3 -0
- data/spec/spec_helper.rb +0 -16
- metadata +54 -26
- data/shippable.yml +0 -10
- data/spec/best_practice_project_spec.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bdb8d0b62983cd414cbd5cd0c9389d4ea16cbdc1eeb277a9016038dbb6798122
|
4
|
+
data.tar.gz: fab168b34ef53f22bae30396eab04ac17d933971bfaf8dcdfd0637916210bac2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6459ed73b03161b3ccd87ba0c3bb4948e7740c65682c59f303660cf53743d64717c0612244d445f028f9d1a301662c66bb6695fada6213e6153278fda1b7063
|
7
|
+
data.tar.gz: cb05887fa560081371c3c7d3f2b7f637bd4ca11b5fac06a1143a062201817f8a09dbf9dae6f2c1f5340b2fda35043f939a14f01bd28ad7188c2e3a97f4001ec8
|
data/.rubocop.yml
CHANGED
@@ -2,13 +2,56 @@ AllCops:
|
|
2
2
|
DisplayCopNames: true
|
3
3
|
DisplayStyleGuide: true
|
4
4
|
Exclude:
|
5
|
+
- db/data_schema.rb
|
5
6
|
- db/schema.rb
|
7
|
+
- node_modules/**/*
|
6
8
|
- spec/dummy/db/schema.rb
|
9
|
+
- best_practice_project.gemspec
|
7
10
|
|
8
|
-
|
9
|
-
|
11
|
+
require:
|
12
|
+
- rubocop-performance
|
13
|
+
- rubocop-rails
|
14
|
+
- rubocop-rspec
|
15
|
+
|
16
|
+
Layout/AccessModifierIndentation:
|
17
|
+
EnforcedStyle: outdent
|
18
|
+
|
19
|
+
Layout/AlignParameters:
|
20
|
+
EnforcedStyle: with_fixed_indentation
|
21
|
+
|
22
|
+
Layout/AlignArguments:
|
23
|
+
EnforcedStyle: with_fixed_indentation
|
24
|
+
|
25
|
+
Layout/CaseIndentation:
|
26
|
+
EnforcedStyle: end
|
27
|
+
|
28
|
+
Layout/EmptyLines:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Layout/EmptyLinesAroundArguments:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Layout/EndAlignment:
|
35
|
+
EnforcedStyleAlignWith: variable
|
36
|
+
|
37
|
+
Layout/MultilineMethodCallIndentation:
|
38
|
+
EnforcedStyle: indented
|
39
|
+
|
40
|
+
Layout/MultilineOperationIndentation:
|
41
|
+
EnforcedStyle: indented
|
42
|
+
|
43
|
+
Layout/SpaceInsideHashLiteralBraces:
|
44
|
+
EnforcedStyle: no_space
|
45
|
+
|
46
|
+
Metrics/AbcSize:
|
47
|
+
Max: 25
|
48
|
+
|
49
|
+
Metrics/BlockLength:
|
10
50
|
Enabled: false
|
11
51
|
|
52
|
+
Metrics/ClassLength:
|
53
|
+
Max: 250
|
54
|
+
|
12
55
|
Metrics/CyclomaticComplexity:
|
13
56
|
Max: 10
|
14
57
|
|
@@ -18,21 +61,45 @@ Metrics/LineLength:
|
|
18
61
|
Metrics/MethodLength:
|
19
62
|
Max: 50
|
20
63
|
|
21
|
-
Metrics/
|
22
|
-
Max:
|
23
|
-
|
24
|
-
Metrics/ClassLength:
|
25
|
-
Max: 250
|
64
|
+
Metrics/PerceivedComplexity:
|
65
|
+
Max: 10
|
26
66
|
|
27
67
|
# .find_each is not the same as .each
|
28
68
|
Rails/FindEach:
|
29
69
|
Enabled: false
|
30
70
|
|
31
|
-
|
32
|
-
|
71
|
+
Rails/Output:
|
72
|
+
Enabled: false
|
33
73
|
|
34
|
-
|
35
|
-
|
74
|
+
RSpec/AnyInstance:
|
75
|
+
Enabled: false
|
76
|
+
|
77
|
+
RSpec/ContextWording:
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
RSpec/DescribeClass:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
RSpec/DescribedClass:
|
84
|
+
Enabled: false
|
85
|
+
|
86
|
+
RSpec/ExampleLength:
|
87
|
+
Enabled: false
|
88
|
+
|
89
|
+
RSpec/LetSetup:
|
90
|
+
Enabled: false
|
91
|
+
|
92
|
+
RSpec/MessageSpies:
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
RSpec/MultipleExpectations:
|
96
|
+
Enabled: false
|
97
|
+
|
98
|
+
RSpec/NamedSubject:
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
RSpec/NestedGroups:
|
102
|
+
Enabled: false
|
36
103
|
|
37
104
|
Style/ClassAndModuleChildren:
|
38
105
|
EnforcedStyle: compact
|
@@ -43,18 +110,21 @@ Style/ConditionalAssignment:
|
|
43
110
|
Style/Documentation:
|
44
111
|
Enabled: false
|
45
112
|
|
46
|
-
Style/
|
113
|
+
Style/FrozenStringLiteralComment:
|
47
114
|
Enabled: false
|
48
115
|
|
49
116
|
# Will report offences for many places that are much more readable without using a guard clause
|
50
117
|
Style/GuardClause:
|
51
118
|
Enabled: false
|
52
119
|
|
53
|
-
Style/
|
54
|
-
|
120
|
+
Style/LambdaCall:
|
121
|
+
Enabled: false
|
55
122
|
|
56
|
-
Style/
|
57
|
-
|
123
|
+
Style/MultipleComparison:
|
124
|
+
Enabled: false
|
125
|
+
|
126
|
+
Style/RegexpLiteral:
|
127
|
+
Enabled: false
|
58
128
|
|
59
129
|
Style/StringLiterals:
|
60
130
|
EnforcedStyle: double_quotes
|
@@ -68,16 +138,12 @@ Style/NilComparison:
|
|
68
138
|
Style/SignalException:
|
69
139
|
EnforcedStyle: only_raise
|
70
140
|
|
71
|
-
Style/
|
72
|
-
|
73
|
-
|
74
|
-
Style/SpaceInsideHashLiteralBraces:
|
75
|
-
EnforcedStyle: no_space
|
141
|
+
Style/SymbolArray:
|
142
|
+
Enabled: false
|
76
143
|
|
77
144
|
Style/TrivialAccessors:
|
78
145
|
ExactNameMatch: true
|
79
146
|
Enabled: true
|
80
147
|
|
81
|
-
|
82
|
-
Style/ClosingParenthesisIndentation:
|
148
|
+
Style/WordArray:
|
83
149
|
Enabled: false
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.7
|
data/Gemfile
CHANGED
@@ -8,9 +8,14 @@ gem "auto_autoloader", ">= 0.0.5"
|
|
8
8
|
# Add dependencies to develop your gem here.
|
9
9
|
# Include everything needed to run rake, tests, features, etc.
|
10
10
|
group :development do
|
11
|
-
gem "
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
gem "
|
11
|
+
gem "juwelier"
|
12
|
+
end
|
13
|
+
|
14
|
+
group :development, :test do
|
15
|
+
gem "bundler"
|
16
|
+
gem "rspec"
|
17
|
+
gem "rubocop", require: false
|
18
|
+
gem "rubocop-performance", require: false
|
19
|
+
gem "rubocop-rails", require: false
|
20
|
+
gem "rubocop-rspec", require: false
|
16
21
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,80 +1,108 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.
|
4
|
+
addressable (2.7.0)
|
5
|
+
public_suffix (>= 2.0.2, < 5.0)
|
6
|
+
ast (2.4.0)
|
5
7
|
auto_autoloader (0.0.5)
|
6
8
|
string-cases
|
7
|
-
builder (3.2.
|
9
|
+
builder (3.2.3)
|
8
10
|
descendants_tracker (0.0.4)
|
9
11
|
thread_safe (~> 0.3, >= 0.3.1)
|
10
|
-
diff-lcs (1.
|
11
|
-
|
12
|
-
faraday (0.9.2)
|
12
|
+
diff-lcs (1.3)
|
13
|
+
faraday (0.17.0)
|
13
14
|
multipart-post (>= 1.2, < 3)
|
14
|
-
git (1.
|
15
|
-
github_api (0.
|
16
|
-
addressable (~> 2.
|
15
|
+
git (1.5.0)
|
16
|
+
github_api (0.18.2)
|
17
|
+
addressable (~> 2.4)
|
17
18
|
descendants_tracker (~> 0.0.4)
|
18
|
-
faraday (~> 0.8
|
19
|
-
hashie (>= 3.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
jeweler (2.0.1)
|
19
|
+
faraday (~> 0.8)
|
20
|
+
hashie (~> 3.5, >= 3.5.2)
|
21
|
+
oauth2 (~> 1.0)
|
22
|
+
hashie (3.6.0)
|
23
|
+
highline (2.0.3)
|
24
|
+
jaro_winkler (1.5.3)
|
25
|
+
juwelier (2.4.9)
|
26
26
|
builder
|
27
|
-
bundler
|
28
|
-
git
|
27
|
+
bundler
|
28
|
+
git
|
29
29
|
github_api
|
30
|
-
highline
|
31
|
-
|
30
|
+
highline
|
31
|
+
kamelcase (~> 0)
|
32
|
+
nokogiri
|
33
|
+
psych
|
32
34
|
rake
|
33
35
|
rdoc
|
34
|
-
|
35
|
-
jwt (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
semver2
|
37
|
+
jwt (2.2.1)
|
38
|
+
kamelcase (0.0.2)
|
39
|
+
semver2 (~> 3)
|
40
|
+
mini_portile2 (2.4.0)
|
41
|
+
multi_json (1.14.1)
|
42
|
+
multi_xml (0.6.0)
|
43
|
+
multipart-post (2.1.1)
|
44
|
+
nokogiri (1.10.4)
|
45
|
+
mini_portile2 (~> 2.4.0)
|
46
|
+
oauth2 (1.4.2)
|
47
|
+
faraday (>= 0.8, < 2.0)
|
48
|
+
jwt (>= 1.0, < 3.0)
|
45
49
|
multi_json (~> 1.3)
|
46
50
|
multi_xml (~> 0.5)
|
47
|
-
rack (
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
rspec
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
51
|
+
rack (>= 1.2, < 3)
|
52
|
+
parallel (1.18.0)
|
53
|
+
parser (2.6.5.0)
|
54
|
+
ast (~> 2.4.0)
|
55
|
+
psych (3.1.0)
|
56
|
+
public_suffix (4.0.1)
|
57
|
+
rack (2.0.7)
|
58
|
+
rainbow (3.0.0)
|
59
|
+
rake (13.0.0)
|
60
|
+
rdoc (6.2.0)
|
61
|
+
rspec (3.9.0)
|
62
|
+
rspec-core (~> 3.9.0)
|
63
|
+
rspec-expectations (~> 3.9.0)
|
64
|
+
rspec-mocks (~> 3.9.0)
|
65
|
+
rspec-core (3.9.0)
|
66
|
+
rspec-support (~> 3.9.0)
|
67
|
+
rspec-expectations (3.9.0)
|
68
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
+
rspec-support (~> 3.9.0)
|
70
|
+
rspec-mocks (3.9.0)
|
71
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
+
rspec-support (~> 3.9.0)
|
73
|
+
rspec-support (3.9.0)
|
74
|
+
rubocop (0.75.1)
|
75
|
+
jaro_winkler (~> 1.5.1)
|
76
|
+
parallel (~> 1.10)
|
77
|
+
parser (>= 2.6)
|
78
|
+
rainbow (>= 2.2.2, < 4.0)
|
79
|
+
ruby-progressbar (~> 1.7)
|
80
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
81
|
+
rubocop-performance (1.5.0)
|
82
|
+
rubocop (>= 0.71.0)
|
83
|
+
rubocop-rails (2.3.2)
|
84
|
+
rack (>= 1.1)
|
85
|
+
rubocop (>= 0.72.0)
|
86
|
+
rubocop-rspec (1.36.0)
|
87
|
+
rubocop (>= 0.68.1)
|
88
|
+
ruby-progressbar (1.10.1)
|
89
|
+
semver2 (3.4.2)
|
65
90
|
string-cases (0.0.4)
|
66
|
-
thread_safe (0.3.
|
91
|
+
thread_safe (0.3.6)
|
92
|
+
unicode-display_width (1.6.0)
|
67
93
|
|
68
94
|
PLATFORMS
|
69
95
|
ruby
|
70
96
|
|
71
97
|
DEPENDENCIES
|
72
98
|
auto_autoloader (>= 0.0.5)
|
73
|
-
bundler
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
99
|
+
bundler
|
100
|
+
juwelier
|
101
|
+
rspec
|
102
|
+
rubocop
|
103
|
+
rubocop-performance
|
104
|
+
rubocop-rails
|
105
|
+
rubocop-rspec
|
78
106
|
|
79
107
|
BUNDLED WITH
|
80
|
-
1.
|
108
|
+
1.17.3
|
data/Rakefile
CHANGED
@@ -1,18 +1,16 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require "rubygems"
|
4
2
|
require "bundler"
|
5
3
|
begin
|
6
4
|
Bundler.setup(:default, :development)
|
7
5
|
rescue Bundler::BundlerError => e
|
8
|
-
|
9
|
-
|
6
|
+
warn e.message
|
7
|
+
warn "Run `bundle install` to install missing gems"
|
10
8
|
exit e.status_code
|
11
9
|
end
|
12
10
|
require "rake"
|
13
11
|
|
14
|
-
require "
|
15
|
-
|
12
|
+
require "juwelier"
|
13
|
+
Juwelier::Tasks.new do |gem|
|
16
14
|
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
15
|
gem.name = "best_practice_project"
|
18
16
|
gem.homepage = "http://github.com/kaspernj/best_practice_project"
|
@@ -23,7 +21,7 @@ Jeweler::Tasks.new do |gem|
|
|
23
21
|
gem.authors = ["kaspernj"]
|
24
22
|
# dependencies defined in Gemfile
|
25
23
|
end
|
26
|
-
|
24
|
+
Juwelier::RubygemsDotOrgTasks.new
|
27
25
|
|
28
26
|
require "rspec/core"
|
29
27
|
require "rspec/core/rake_task"
|
@@ -31,23 +29,7 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
31
29
|
spec.pattern = FileList["spec/**/*_spec.rb"]
|
32
30
|
end
|
33
31
|
|
34
|
-
desc "Code coverage detail"
|
35
|
-
task :simplecov do
|
36
|
-
ENV["COVERAGE"] = "true"
|
37
|
-
Rake::Task["spec"].execute
|
38
|
-
end
|
39
|
-
|
40
32
|
task default: :spec
|
41
33
|
|
42
|
-
|
43
|
-
Rake::RDocTask.new do |rdoc|
|
44
|
-
version = File.exist?("VERSION") ? File.read("VERSION") : ""
|
45
|
-
|
46
|
-
rdoc.rdoc_dir = "rdoc"
|
47
|
-
rdoc.title = "best_practice_project #{version}"
|
48
|
-
rdoc.rdoc_files.include("README*")
|
49
|
-
rdoc.rdoc_files.include("lib/**/*.rb")
|
50
|
-
end
|
51
|
-
|
52
|
-
require "best_practice_project"
|
34
|
+
require_relative "lib/best_practice_project"
|
53
35
|
BestPracticeProject.load_tasks
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
@@ -1,19 +1,19 @@
|
|
1
|
-
# Generated by
|
1
|
+
# Generated by juwelier
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit
|
3
|
+
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: best_practice_project 0.0.
|
5
|
+
# stub: best_practice_project 0.0.11 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "best_practice_project"
|
9
|
-
s.version = "0.0.
|
8
|
+
s.name = "best_practice_project".freeze
|
9
|
+
s.version = "0.0.11"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["kaspernj"]
|
14
|
-
s.date = "
|
15
|
-
s.description = "A bundle of various linters and code inspection tools"
|
16
|
-
s.email = "k@spernj.org"
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["kaspernj".freeze]
|
14
|
+
s.date = "2019-10-21"
|
15
|
+
s.description = "A bundle of various linters and code inspection tools".freeze
|
16
|
+
s.email = "k@spernj.org".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE.txt",
|
19
19
|
"README.md"
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
".document",
|
23
23
|
".rspec",
|
24
24
|
".rubocop.yml",
|
25
|
+
".ruby-version",
|
25
26
|
"Gemfile",
|
26
27
|
"Gemfile.lock",
|
27
28
|
"LICENSE.txt",
|
@@ -33,46 +34,52 @@ Gem::Specification.new do |s|
|
|
33
34
|
"lib/best_practice_project/base_handler.rb",
|
34
35
|
"lib/best_practice_project/coffee_lint_handler.rb",
|
35
36
|
"lib/best_practice_project/config/haml-lint.yml",
|
37
|
+
"lib/best_practice_project/config/rails_best_practices.yml",
|
36
38
|
"lib/best_practice_project/config/rubocop.yml",
|
37
39
|
"lib/best_practice_project/haml_lint_handler.rb",
|
38
40
|
"lib/best_practice_project/rails_best_practices_handler.rb",
|
39
41
|
"lib/best_practice_project/rubocop_handler.rb",
|
40
42
|
"lib/best_practice_project/scss_lint_handler.rb",
|
41
43
|
"lib/tasks/best_practice_project.rake",
|
42
|
-
"
|
43
|
-
"spec/best_practice_project_spec.rb",
|
44
|
+
"peak_flow.yml",
|
44
45
|
"spec/spec_helper.rb"
|
45
46
|
]
|
46
|
-
s.homepage = "http://github.com/kaspernj/best_practice_project"
|
47
|
-
s.licenses = ["MIT"]
|
48
|
-
s.rubygems_version = "
|
49
|
-
s.summary = "A bundle of various linters and code inspection tools"
|
47
|
+
s.homepage = "http://github.com/kaspernj/best_practice_project".freeze
|
48
|
+
s.licenses = ["MIT".freeze]
|
49
|
+
s.rubygems_version = "3.0.6".freeze
|
50
|
+
s.summary = "A bundle of various linters and code inspection tools".freeze
|
50
51
|
|
51
52
|
if s.respond_to? :specification_version then
|
52
53
|
s.specification_version = 4
|
53
54
|
|
54
55
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
55
|
-
s.add_runtime_dependency(%q<auto_autoloader
|
56
|
-
s.add_development_dependency(%q<
|
57
|
-
s.add_development_dependency(%q<
|
58
|
-
s.add_development_dependency(%q<
|
59
|
-
s.add_development_dependency(%q<
|
60
|
-
s.add_development_dependency(%q<
|
56
|
+
s.add_runtime_dependency(%q<auto_autoloader>.freeze, [">= 0.0.5"])
|
57
|
+
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
58
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
|
59
|
+
s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
|
60
|
+
s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
|
61
|
+
s.add_development_dependency(%q<rubocop-performance>.freeze, [">= 0"])
|
62
|
+
s.add_development_dependency(%q<rubocop-rails>.freeze, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<rubocop-rspec>.freeze, [">= 0"])
|
61
64
|
else
|
62
|
-
s.add_dependency(%q<auto_autoloader
|
63
|
-
s.add_dependency(%q<
|
64
|
-
s.add_dependency(%q<
|
65
|
-
s.add_dependency(%q<
|
66
|
-
s.add_dependency(%q<
|
67
|
-
s.add_dependency(%q<
|
65
|
+
s.add_dependency(%q<auto_autoloader>.freeze, [">= 0.0.5"])
|
66
|
+
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
67
|
+
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
68
|
+
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
69
|
+
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
70
|
+
s.add_dependency(%q<rubocop-performance>.freeze, [">= 0"])
|
71
|
+
s.add_dependency(%q<rubocop-rails>.freeze, [">= 0"])
|
72
|
+
s.add_dependency(%q<rubocop-rspec>.freeze, [">= 0"])
|
68
73
|
end
|
69
74
|
else
|
70
|
-
s.add_dependency(%q<auto_autoloader
|
71
|
-
s.add_dependency(%q<
|
72
|
-
s.add_dependency(%q<
|
73
|
-
s.add_dependency(%q<
|
74
|
-
s.add_dependency(%q<
|
75
|
-
s.add_dependency(%q<
|
75
|
+
s.add_dependency(%q<auto_autoloader>.freeze, [">= 0.0.5"])
|
76
|
+
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
77
|
+
s.add_dependency(%q<bundler>.freeze, [">= 0"])
|
78
|
+
s.add_dependency(%q<rspec>.freeze, [">= 0"])
|
79
|
+
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
80
|
+
s.add_dependency(%q<rubocop-performance>.freeze, [">= 0"])
|
81
|
+
s.add_dependency(%q<rubocop-rails>.freeze, [">= 0"])
|
82
|
+
s.add_dependency(%q<rubocop-rspec>.freeze, [">= 0"])
|
76
83
|
end
|
77
84
|
end
|
78
85
|
|
@@ -5,8 +5,7 @@ require "auto_autoloader"
|
|
5
5
|
class BestPracticeProject
|
6
6
|
AutoAutoloader.autoload_sub_classes(self, __FILE__)
|
7
7
|
|
8
|
-
attr_reader :
|
9
|
-
alias_method :rails?, :rails
|
8
|
+
attr_reader :rubocop_handler, :haml_lint_handler, :scss_lint_handler, :coffee_lint_handler, :rails_best_practices_handler
|
10
9
|
|
11
10
|
def self.load_tasks
|
12
11
|
load "#{File.dirname(__FILE__)}/tasks/best_practice_project.rake"
|
@@ -0,0 +1,49 @@
|
|
1
|
+
AddModelVirtualAttributeCheck: { }
|
2
|
+
AlwaysAddDbIndexCheck: { }
|
3
|
+
#CheckSaveReturnValueCheck: { }
|
4
|
+
#CheckDestroyReturnValueCheck: { }
|
5
|
+
DefaultScopeIsEvilCheck: { }
|
6
|
+
DryBundlerInCapistranoCheck: { }
|
7
|
+
#HashSyntaxCheck: { }
|
8
|
+
IsolateSeedDataCheck: { }
|
9
|
+
KeepFindersOnTheirOwnModelCheck: { }
|
10
|
+
LawOfDemeterCheck: { }
|
11
|
+
#LongLineCheck: { max_line_length: 80 }
|
12
|
+
MoveCodeIntoControllerCheck: { }
|
13
|
+
MoveCodeIntoHelperCheck: { array_count: 3 }
|
14
|
+
MoveCodeIntoModelCheck: { use_count: 2 }
|
15
|
+
MoveFinderToNamedScopeCheck: { }
|
16
|
+
MoveModelLogicIntoModelCheck: { use_count: 6 }
|
17
|
+
NeedlessDeepNestingCheck: { nested_count: 3 }
|
18
|
+
NotRescueExceptionCheck: { }
|
19
|
+
NotUseDefaultRouteCheck: { }
|
20
|
+
NotUseTimeAgoInWordsCheck: { }
|
21
|
+
OveruseRouteCustomizationsCheck: { customize_count: 3 }
|
22
|
+
ProtectMassAssignmentCheck: { }
|
23
|
+
RemoveEmptyHelpersCheck: { }
|
24
|
+
#RemoveTabCheck: { }
|
25
|
+
RemoveTrailingWhitespaceCheck: { }
|
26
|
+
RemoveUnusedMethodsInControllersCheck: {
|
27
|
+
except_methods: [
|
28
|
+
"*#.*_params$", # Used by CanCan
|
29
|
+
"*#current_ability", # Used by CanCan
|
30
|
+
"ApplicationController#after_sign_in_path_for", # Used by Devise
|
31
|
+
"ApplicationController#set_locale"
|
32
|
+
]
|
33
|
+
}
|
34
|
+
RemoveUnusedMethodsInHelpersCheck: { except_methods: [] }
|
35
|
+
RemoveUnusedMethodsInModelsCheck: { except_methods: [] }
|
36
|
+
ReplaceComplexCreationWithFactoryMethodCheck: { attribute_assignment_count: 2 }
|
37
|
+
ReplaceInstanceVariableWithLocalVariableCheck: { }
|
38
|
+
RestrictAutoGeneratedRoutesCheck: { }
|
39
|
+
SimplifyRenderInControllersCheck: { }
|
40
|
+
SimplifyRenderInViewsCheck: { }
|
41
|
+
#UseBeforeFilterCheck: { customize_count: 2 }
|
42
|
+
UseModelAssociationCheck: { }
|
43
|
+
#UseMultipartAlternativeAsContentTypeOfEmailCheck: { }
|
44
|
+
#UseParenthesesInMethodDefCheck: { }
|
45
|
+
UseObserverCheck: { }
|
46
|
+
UseQueryAttributeCheck: { }
|
47
|
+
UseSayWithTimeInMigrationsCheck: { }
|
48
|
+
UseScopeAccessCheck: { }
|
49
|
+
UseTurboSprocketsRails3Check: { }
|
@@ -2,13 +2,58 @@ AllCops:
|
|
2
2
|
DisplayCopNames: true
|
3
3
|
DisplayStyleGuide: true
|
4
4
|
Exclude:
|
5
|
+
- db/data_schema.rb
|
5
6
|
- db/schema.rb
|
7
|
+
- node_modules/**/*
|
6
8
|
- spec/dummy/db/schema.rb
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
+
require:
|
11
|
+
- rubocop-performance
|
12
|
+
- rubocop-rails
|
13
|
+
- rubocop-rspec
|
14
|
+
|
15
|
+
Layout/AccessModifierIndentation:
|
16
|
+
EnforcedStyle: outdent
|
17
|
+
|
18
|
+
Layout/AlignParameters:
|
19
|
+
EnforcedStyle: with_fixed_indentation
|
20
|
+
|
21
|
+
Layout/AlignArguments:
|
22
|
+
EnforcedStyle: with_fixed_indentation
|
23
|
+
|
24
|
+
Layout/CaseIndentation:
|
25
|
+
EnforcedStyle: end
|
26
|
+
|
27
|
+
Layout/EmptyLines:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Layout/EmptyLinesAroundArguments:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Layout/EndAlignment:
|
34
|
+
EnforcedStyleAlignWith: variable
|
35
|
+
|
36
|
+
Layout/MultilineMethodCallIndentation:
|
37
|
+
EnforcedStyle: indented
|
38
|
+
|
39
|
+
Layout/MultilineOperationIndentation:
|
40
|
+
EnforcedStyle: indented
|
41
|
+
|
42
|
+
Layout/RescueEnsureAlignment:
|
10
43
|
Enabled: false
|
11
44
|
|
45
|
+
Layout/SpaceInsideHashLiteralBraces:
|
46
|
+
EnforcedStyle: no_space
|
47
|
+
|
48
|
+
Metrics/AbcSize:
|
49
|
+
Max: 25
|
50
|
+
|
51
|
+
Metrics/BlockLength:
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
Metrics/ClassLength:
|
55
|
+
Max: 250
|
56
|
+
|
12
57
|
Metrics/CyclomaticComplexity:
|
13
58
|
Max: 10
|
14
59
|
|
@@ -18,21 +63,42 @@ Metrics/LineLength:
|
|
18
63
|
Metrics/MethodLength:
|
19
64
|
Max: 50
|
20
65
|
|
21
|
-
Metrics/
|
22
|
-
Max:
|
23
|
-
|
24
|
-
Metrics/ClassLength:
|
25
|
-
Max: 250
|
66
|
+
Metrics/PerceivedComplexity:
|
67
|
+
Max: 10
|
26
68
|
|
27
69
|
# .find_each is not the same as .each
|
28
70
|
Rails/FindEach:
|
29
71
|
Enabled: false
|
30
72
|
|
31
|
-
|
32
|
-
|
73
|
+
RSpec/AnyInstance:
|
74
|
+
Enabled: false
|
33
75
|
|
34
|
-
|
35
|
-
|
76
|
+
RSpec/ContextWording:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
RSpec/DescribeClass:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
RSpec/DescribedClass:
|
83
|
+
Enabled: false
|
84
|
+
|
85
|
+
RSpec/ExampleLength:
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
RSpec/LetSetup:
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
RSpec/MessageSpies:
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
RSpec/MultipleExpectations:
|
95
|
+
Enabled: false
|
96
|
+
|
97
|
+
RSpec/NamedSubject:
|
98
|
+
Enabled: false
|
99
|
+
|
100
|
+
RSpec/NestedGroups:
|
101
|
+
Enabled: false
|
36
102
|
|
37
103
|
Style/ClassAndModuleChildren:
|
38
104
|
EnforcedStyle: compact
|
@@ -43,18 +109,24 @@ Style/ConditionalAssignment:
|
|
43
109
|
Style/Documentation:
|
44
110
|
Enabled: false
|
45
111
|
|
46
|
-
Style/
|
112
|
+
Style/FrozenStringLiteralComment:
|
47
113
|
Enabled: false
|
48
114
|
|
49
115
|
# Will report offences for many places that are much more readable without using a guard clause
|
50
116
|
Style/GuardClause:
|
51
117
|
Enabled: false
|
52
118
|
|
53
|
-
Style/
|
54
|
-
|
119
|
+
Style/Lambda:
|
120
|
+
Enabled: false
|
55
121
|
|
56
|
-
Style/
|
57
|
-
|
122
|
+
Style/LambdaCall:
|
123
|
+
Enabled: false
|
124
|
+
|
125
|
+
Style/MultipleComparison:
|
126
|
+
Enabled: false
|
127
|
+
|
128
|
+
Style/RegexpLiteral:
|
129
|
+
Enabled: false
|
58
130
|
|
59
131
|
Style/StringLiterals:
|
60
132
|
EnforcedStyle: double_quotes
|
@@ -68,16 +140,12 @@ Style/NilComparison:
|
|
68
140
|
Style/SignalException:
|
69
141
|
EnforcedStyle: only_raise
|
70
142
|
|
71
|
-
Style/
|
72
|
-
|
73
|
-
|
74
|
-
Style/SpaceInsideHashLiteralBraces:
|
75
|
-
EnforcedStyle: no_space
|
143
|
+
Style/SymbolArray:
|
144
|
+
Enabled: false
|
76
145
|
|
77
146
|
Style/TrivialAccessors:
|
78
147
|
ExactNameMatch: true
|
79
148
|
Enabled: true
|
80
149
|
|
81
|
-
|
82
|
-
Style/ClosingParenthesisIndentation:
|
150
|
+
Style/WordArray:
|
83
151
|
Enabled: false
|
@@ -15,7 +15,6 @@ class BestPracticeProject::RubocopHandler < BestPracticeProject::BaseHandler
|
|
15
15
|
|
16
16
|
def command
|
17
17
|
command = "bundle exec rubocop --display-cop-names"
|
18
|
-
command << " --rails" if rails?
|
19
18
|
command << " --auto-correct" if ARGV.include?("auto-correct")
|
20
19
|
|
21
20
|
command
|
data/peak_flow.yml
ADDED
data/spec/spec_helper.rb
CHANGED
@@ -1,19 +1,3 @@
|
|
1
|
-
require "simplecov"
|
2
|
-
|
3
|
-
module SimpleCov::Configuration
|
4
|
-
def clean_filters
|
5
|
-
@filters = []
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
SimpleCov.configure do
|
10
|
-
clean_filters
|
11
|
-
load_adapter "test_frameworks"
|
12
|
-
end
|
13
|
-
|
14
|
-
ENV["COVERAGE"] && SimpleCov.start do
|
15
|
-
add_filter "/.rvm/"
|
16
|
-
end
|
17
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
18
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
19
3
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: best_practice_project
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaspernj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: auto_autoloader
|
@@ -24,64 +24,92 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.5
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: juwelier
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: rspec
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
|
-
- - "
|
59
|
+
- - ">="
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
61
|
+
version: '0'
|
34
62
|
type: :development
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
|
-
- - "
|
66
|
+
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
70
|
+
name: rubocop
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
|
-
- - "
|
73
|
+
- - ">="
|
46
74
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
75
|
+
version: '0'
|
48
76
|
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
|
-
- - "
|
80
|
+
- - ">="
|
53
81
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
84
|
+
name: rubocop-performance
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
58
86
|
requirements:
|
59
|
-
- - "
|
87
|
+
- - ">="
|
60
88
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
89
|
+
version: '0'
|
62
90
|
type: :development
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
|
-
- - "
|
94
|
+
- - ">="
|
67
95
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
98
|
+
name: rubocop-rails
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
|
-
- - "
|
101
|
+
- - ">="
|
74
102
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
103
|
+
version: '0'
|
76
104
|
type: :development
|
77
105
|
prerelease: false
|
78
106
|
version_requirements: !ruby/object:Gem::Requirement
|
79
107
|
requirements:
|
80
|
-
- - "
|
108
|
+
- - ">="
|
81
109
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
110
|
+
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
112
|
+
name: rubocop-rspec
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
86
114
|
requirements:
|
87
115
|
- - ">="
|
@@ -105,6 +133,7 @@ files:
|
|
105
133
|
- ".document"
|
106
134
|
- ".rspec"
|
107
135
|
- ".rubocop.yml"
|
136
|
+
- ".ruby-version"
|
108
137
|
- Gemfile
|
109
138
|
- Gemfile.lock
|
110
139
|
- LICENSE.txt
|
@@ -116,14 +145,14 @@ files:
|
|
116
145
|
- lib/best_practice_project/base_handler.rb
|
117
146
|
- lib/best_practice_project/coffee_lint_handler.rb
|
118
147
|
- lib/best_practice_project/config/haml-lint.yml
|
148
|
+
- lib/best_practice_project/config/rails_best_practices.yml
|
119
149
|
- lib/best_practice_project/config/rubocop.yml
|
120
150
|
- lib/best_practice_project/haml_lint_handler.rb
|
121
151
|
- lib/best_practice_project/rails_best_practices_handler.rb
|
122
152
|
- lib/best_practice_project/rubocop_handler.rb
|
123
153
|
- lib/best_practice_project/scss_lint_handler.rb
|
124
154
|
- lib/tasks/best_practice_project.rake
|
125
|
-
-
|
126
|
-
- spec/best_practice_project_spec.rb
|
155
|
+
- peak_flow.yml
|
127
156
|
- spec/spec_helper.rb
|
128
157
|
homepage: http://github.com/kaspernj/best_practice_project
|
129
158
|
licenses:
|
@@ -144,8 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
173
|
- !ruby/object:Gem::Version
|
145
174
|
version: '0'
|
146
175
|
requirements: []
|
147
|
-
|
148
|
-
rubygems_version: 2.2.2
|
176
|
+
rubygems_version: 3.0.6
|
149
177
|
signing_key:
|
150
178
|
specification_version: 4
|
151
179
|
summary: A bundle of various linters and code inspection tools
|
data/shippable.yml
DELETED