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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4558fbf8708c836a3ed1b13c07831f92f02f60a3e428996df38002ba68540440
4
- data.tar.gz: b8423308b7ad62219226f0db48bebbcd9bde088f7ba3a938e93c078e914c08ee
3
+ metadata.gz: 32df7c2136c9843336bff23949966d6a557932631bc0d143a0b76111981aef71
4
+ data.tar.gz: 0b05601c199203849589a13c5469dccc3a6017dfbe07661c96d5f073846507d7
5
5
  SHA512:
6
- metadata.gz: c91904bc9d0a53b0d626e642d4cc86b0436457e20e4d623c530116869dcd34c6df8e41f9447ab3688f3e2c0b4f7866ca300c83f91e5a67587379f1e7676cb14d
7
- data.tar.gz: 45307edbf9c217bf7f757b59f3d98e5fec1902a60bb8079c043a4a846d3d653ce301a8de146cd911b74603c80c08a64db524292046b5f0dfdf0fc66567fc3148
6
+ metadata.gz: 7b2362aacc03c71f192f5fe671c8dd6270311a39f8be31b9fa712b9e67be36a114590ced0c21cd82a0d846d47a6d150592c63d7bf46ee691cd8c821220ace4e8
7
+ data.tar.gz: c49866725411c9e47a40967b171338651a0a8fc9ff8d1288c8d688be178e8ec80598971371fa1281dac5efbc94cfbbafc50287c2e20741714e711f39f8911530
data/Gemfile CHANGED
@@ -10,3 +10,4 @@ gem 'bundler', '~> 1.16.a'
10
10
  gem 'pry', '~> 0.10', '>= 0.10.0'
11
11
  gem 'rake', '~> 12.1'
12
12
  gem 'rspec', '~> 3.0'
13
+ gem 'single_cov', group: :test
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ducalis (0.9.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.0)
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 `Meneger`, `Client` and so on. If it has no parts, change the name of the class to what each object is managing.
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 =~ /#{suffix}\Z/ }
27
+ cop_config['BlackList'].any? { |suffix| name.end_with?(suffix) }
28
28
  end
29
29
  end
30
30
  end
@@ -10,7 +10,6 @@ module Ducalis
10
10
 
11
11
  def on_def(node)
12
12
  args = node.type == :defs ? node.to_a[2] : node.to_a[1]
13
- return unless args
14
13
  args.children.each do |arg_node|
15
14
  next unless arg_node.type == :optarg
16
15
  add_offense(node, :expression, OFFENSE)
@@ -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, args = *node
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
 
@@ -17,7 +17,8 @@ class GitAccess
17
17
 
18
18
  attr_accessor :flag, :repo, :id
19
19
 
20
- def store_pull_request!(repo, id)
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
- return NilDiff.new(nil, path) if changes.empty?
59
- changes.find { |diff| diff.path == path }
59
+ changes.find { |diff| diff.path == path } || NilDiff.new(nil, path)
60
60
  end
61
61
  end
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class GithubFormatter < RuboCop::Formatter::BaseFormatter
4
+ attr_reader :all
5
+
4
6
  def started(_target_files)
5
7
  @all = []
6
8
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ducalis
4
- VERSION = '0.9.0'.freeze
4
+ VERSION = '0.10.0'.freeze
5
5
  end
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.9.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-09 00:00:00.000000000 Z
11
+ date: 2018-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git