ragnarson-stylecheck 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d024735e08f3f50dc4b3d43b9b638c774887a450
|
4
|
+
data.tar.gz: 6e56891b8088237878f641235a2b413d25fdfb6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6bc15c37f45bec17f6b6966d2ab3c5506a9b63069be9c5ce4440ad75bb5cd6982bfe753efbde6f69305c66249d9051fb8bc7db750ef6be64899d887676d1b14
|
7
|
+
data.tar.gz: 89bc356fd5bb98c815d2a9d6d7be5d10c55a3436be2f0e08ec1740a874ec442c25309a756efec6f78aff1351dc9cfd7e4beada12c4955f12065d956e40d8cb17
|
data/config/rubocop.yml
CHANGED
@@ -28,6 +28,9 @@ Style/Encoding:
|
|
28
28
|
Style/InlineComment:
|
29
29
|
Enabled: false
|
30
30
|
|
31
|
+
Style/MultilineBlockChain:
|
32
|
+
Enabled: false
|
33
|
+
|
31
34
|
Style/MultilineOperationIndentation:
|
32
35
|
EnforcedStyle: indented
|
33
36
|
|
@@ -42,7 +45,6 @@ Style/Semicolon:
|
|
42
45
|
# Allow ; to separate several expressions on the same line.
|
43
46
|
AllowAsExpressionSeparator: true
|
44
47
|
|
45
|
-
|
46
48
|
Style/StringLiterals:
|
47
49
|
EnforcedStyle: double_quotes
|
48
50
|
Exclude:
|
@@ -64,6 +66,12 @@ Style/RaiseArgs:
|
|
64
66
|
Style/AndOr:
|
65
67
|
EnforcedStyle: conditionals
|
66
68
|
|
69
|
+
Style/EachWithObject:
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
Lint/AssignmentInCondition:
|
73
|
+
Enabled: false
|
74
|
+
|
67
75
|
##################### Metrics ##################################
|
68
76
|
|
69
77
|
Metrics/AbcSize:
|
@@ -84,3 +92,8 @@ Metrics/LineLength:
|
|
84
92
|
AllCops:
|
85
93
|
Exclude:
|
86
94
|
- db/schema.rb
|
95
|
+
- bin/**
|
96
|
+
|
97
|
+
Style/Blocks:
|
98
|
+
Exclude:
|
99
|
+
- "spec/**/*"
|
data/lib/ragnarson/rake_task.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
load
|
1
|
+
require "rake"
|
2
|
+
load "ragnarson/tasks/rubocop.rake"
|
@@ -3,7 +3,7 @@ module Ragnarson
|
|
3
3
|
# auto loading rake tasks
|
4
4
|
class Railtie < Rails::Railtie
|
5
5
|
rake_tasks do
|
6
|
-
rake_path = File.join(File.dirname(__FILE__),
|
6
|
+
rake_path = File.join(File.dirname(__FILE__), "../tasks/*.rake")
|
7
7
|
Dir[rake_path].each { |f| load f }
|
8
8
|
end
|
9
9
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "fileutils"
|
2
2
|
|
3
3
|
module Ragnarson
|
4
4
|
module Stylecheck
|
@@ -6,7 +6,7 @@ module Ragnarson
|
|
6
6
|
module RubocopHelpers
|
7
7
|
class << self
|
8
8
|
def config
|
9
|
-
File.join(Ragnarson::Stylecheck.root,
|
9
|
+
File.join(Ragnarson::Stylecheck.root, "config", "rubocop.yml")
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
data/lib/ragnarson/stylecheck.rb
CHANGED
@@ -3,11 +3,11 @@ module Ragnarson
|
|
3
3
|
module Stylecheck
|
4
4
|
class << self
|
5
5
|
def root
|
6
|
-
Gem::Specification.find_by_name(
|
6
|
+
Gem::Specification.find_by_name("ragnarson-stylecheck").gem_dir
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
require
|
13
|
-
require
|
12
|
+
require "ragnarson/stylecheck/rubocop_helpers"
|
13
|
+
require "ragnarson/stylecheck/railtie" if defined?(Rails)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "ragnarson/stylecheck"
|
2
2
|
require "fileutils"
|
3
3
|
|
4
4
|
namespace :style do
|
@@ -8,18 +8,18 @@ namespace :style do
|
|
8
8
|
options = ["--rails", "--auto-correct"]
|
9
9
|
options += ["--fail-level", "refactor"]
|
10
10
|
options += ["-c", Ragnarson::Stylecheck::RubocopHelpers.config]
|
11
|
-
sh "bundle exec rubocop #{options.join(
|
11
|
+
sh "bundle exec rubocop #{options.join(" ")}" do |ok, _res|
|
12
12
|
abort "Fix code style errors" unless ok
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
desc
|
16
|
+
desc "Run RuboCop without auto_correct"
|
17
17
|
task :without_auto_correct do
|
18
18
|
options = ["--rails"]
|
19
19
|
options += ["--fail-level", "refactor"]
|
20
20
|
options += ["--display-cop-names"]
|
21
21
|
options += ["-c", Ragnarson::Stylecheck::RubocopHelpers.config]
|
22
|
-
sh "bundle exec rubocop #{options.join(
|
22
|
+
sh "bundle exec rubocop #{options.join(" ")}" do |ok, _res|
|
23
23
|
abort "Fix code style errors" unless ok
|
24
24
|
end
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ragnarson-stylecheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Marciniak
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
62
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.4.5
|
63
|
+
rubygems_version: 2.4.5.1
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: Automatic style check for ragnarson projects
|