ducalis 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -2
- data/README.md +1 -1
- data/lib/ducalis/cops/black_list_suffix.rb +2 -2
- data/lib/ducalis/cops/keyword_defaults.rb +0 -1
- data/lib/ducalis/cops/uncommented_gem.rb +1 -2
- data/lib/ducalis/documentation.rb +2 -2
- data/lib/ducalis/git_access.rb +4 -4
- data/lib/ducalis/github_formatter.rb +2 -0
- data/lib/ducalis/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32df7c2136c9843336bff23949966d6a557932631bc0d143a0b76111981aef71
|
4
|
+
data.tar.gz: 0b05601c199203849589a13c5469dccc3a6017dfbe07661c96d5f073846507d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b2362aacc03c71f192f5fe671c8dd6270311a39f8be31b9fa712b9e67be36a114590ced0c21cd82a0d846d47a6d150592c63d7bf46ee691cd8c821220ace4e8
|
7
|
+
data.tar.gz: c49866725411c9e47a40967b171338651a0a8fc9ff8d1288c8d688be178e8ec80598971371fa1281dac5efbc94cfbbafc50287c2e20741714e711f39f8911530
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ducalis (0.
|
4
|
+
ducalis (0.10.0)
|
5
5
|
git (~> 1.3, >= 1.3.0)
|
6
6
|
octokit (>= 4.1.0)
|
7
7
|
regexp-examples (~> 1.3, >= 1.3.2)
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
ast (2.4.0)
|
16
16
|
coderay (1.1.2)
|
17
17
|
diff-lcs (1.3)
|
18
|
-
faraday (0.15.
|
18
|
+
faraday (0.15.1)
|
19
19
|
multipart-post (>= 1.2, < 3)
|
20
20
|
git (1.3.0)
|
21
21
|
method_source (0.9.0)
|
@@ -57,6 +57,7 @@ GEM
|
|
57
57
|
sawyer (0.8.1)
|
58
58
|
addressable (>= 2.3.5, < 2.6)
|
59
59
|
faraday (~> 0.8, < 1.0)
|
60
|
+
single_cov (1.0.3)
|
60
61
|
unicode-display_width (1.3.2)
|
61
62
|
|
62
63
|
PLATFORMS
|
@@ -68,6 +69,7 @@ DEPENDENCIES
|
|
68
69
|
pry (~> 0.10, >= 0.10.0)
|
69
70
|
rake (~> 12.1)
|
70
71
|
rspec (~> 3.0)
|
72
|
+
single_cov
|
71
73
|
|
72
74
|
BUNDLED WITH
|
73
75
|
1.16.1
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
__Ducalis__ is RuboCop-based static code analyzer for enterprise Rails applications.
|
8
8
|
|
9
|
-
Documentation available at https://ducalis-rb.github.io/.
|
9
|
+
Documentation available at https://ducalis-rb.github.io/. Changelog at https://ducalis-rb.github.io/log.
|
10
10
|
|
11
11
|
__Ducalis__ isn't style checker and could sometimes be false-positive it's not
|
12
12
|
necessary to follow all it rules, the main purpose of __Ducalis__ is help to find
|
@@ -5,7 +5,7 @@ require 'rubocop'
|
|
5
5
|
module Ducalis
|
6
6
|
class BlackListSuffix < RuboCop::Cop::Cop
|
7
7
|
OFFENSE = <<-MESSAGE.gsub(/^ +\|\s/, '').strip
|
8
|
-
| Please, avoid using of class suffixes like `
|
8
|
+
| Please, avoid using of class suffixes like `Manager`, `Client` and so on. If it has no parts, change the name of the class to what each object is managing.
|
9
9
|
|
10
10
|
| It's ok to use Manager as subclass of Person, which is there to refine a type of personal that has management behavior to it.
|
11
11
|
MESSAGE
|
@@ -24,7 +24,7 @@ module Ducalis
|
|
24
24
|
|
25
25
|
def with_blacklisted_suffix?(name)
|
26
26
|
return if cop_config['BlackList'].to_a.empty?
|
27
|
-
cop_config['BlackList'].any? { |suffix| name
|
27
|
+
cop_config['BlackList'].any? { |suffix| name.end_with?(suffix) }
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -17,8 +17,7 @@ module Ducalis
|
|
17
17
|
def investigate(processed_source)
|
18
18
|
return unless processed_source.ast
|
19
19
|
gem_declarations(processed_source.ast).select do |node|
|
20
|
-
_, _, gemname,
|
21
|
-
next if args.nil? || args.type == :str
|
20
|
+
_, _, gemname, _args = *node
|
22
21
|
next if commented?(processed_source, node)
|
23
22
|
add_offense(node, :selector,
|
24
23
|
format(OFFENSE, gem: gemname.loc.expression.source))
|
@@ -35,8 +35,8 @@ class SpecsProcessor < Parser::AST::Processor
|
|
35
35
|
|
36
36
|
def source_code(node)
|
37
37
|
prepare_code(node).tap do |code|
|
38
|
-
code.shift if code.first.empty?
|
39
|
-
code.pop if code.last.empty?
|
38
|
+
code.shift if code.first.to_s.empty?
|
39
|
+
code.pop if code.last.to_s.empty?
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
data/lib/ducalis/git_access.rb
CHANGED
@@ -17,7 +17,8 @@ class GitAccess
|
|
17
17
|
|
18
18
|
attr_accessor :flag, :repo, :id
|
19
19
|
|
20
|
-
def store_pull_request!(
|
20
|
+
def store_pull_request!(info)
|
21
|
+
repo, id = info
|
21
22
|
self.repo = repo
|
22
23
|
self.id = id
|
23
24
|
end
|
@@ -50,12 +51,11 @@ class GitAccess
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def default_value
|
53
|
-
raise MissingGit unless flag.nil?
|
54
|
+
raise Ducalis::MissingGit unless flag.nil?
|
54
55
|
[]
|
55
56
|
end
|
56
57
|
|
57
58
|
def find(path)
|
58
|
-
|
59
|
-
changes.find { |diff| diff.path == path }
|
59
|
+
changes.find { |diff| diff.path == path } || NilDiff.new(nil, path)
|
60
60
|
end
|
61
61
|
end
|
data/lib/ducalis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ducalis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ignat Zakrevsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|