danger-wcc 0.0.4 → 0.0.5

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: dad1e51611091d1975c1e79440afed906f5d2119
4
- data.tar.gz: 608950050d3e357cbd078ac47e2fb1afa89e1086
3
+ metadata.gz: 2559417d0fc17cc5432a264afe84b98076248c88
4
+ data.tar.gz: 7bd3382415a0414c6b48214c28806f13356f822f
5
5
  SHA512:
6
- metadata.gz: e8bb8cd98d97f1664c34e54c893dc8995171317094602fc7034fe37adeca823230ced817c6fd7fd47247edbda6c1de250ab953c74a8f61dc0f3d2dc91ce7e31e
7
- data.tar.gz: 48b2f49e8a642e049e2ae34ff85bf3053aea695c4ad3404de4db4c3f828921941dbc929fe1f7cc2dfe82be656cf1c18f8de5aff7198b0bf1025566287e9a9d06
6
+ metadata.gz: fee811c11bdb726932f1964379bade0ce0a4e61ff6d26acb34734155bd2048abfa707c15188c0e9dae2251a9ae77e53eb5f958433a1cf7c032caab6cc116edf9
7
+ data.tar.gz: 512a9dba219287d1640e7bf7c4f57c9399e82760e31c0efab9cf6c7692f6af853e285588cc35384056fd95d0acce3e3f23e5d258a39b3fac5d55213e983520e5
data/.rubocop.yml CHANGED
@@ -2,6 +2,7 @@ AllCops:
2
2
  DisplayCopNames: true
3
3
  TargetRubyVersion: 2.3
4
4
  Exclude:
5
+ - 'spec/fixtures/**/*'
5
6
  # generated by rails/binstubs
6
7
  - 'bin/**/*'
7
8
 
@@ -46,9 +47,11 @@ Metrics/ModuleLength:
46
47
  - 'lib/wcc/utils.rb'
47
48
  - 'spec/**/*.rb'
48
49
 
49
- Performance/HashEachMethods:
50
- Exclude:
51
- - 'spec/**/*.rb'
50
+ Naming/UncommunicativeMethodParamName:
51
+ Enabled: false
52
+
53
+ Naming/MemoizedInstanceVariableName:
54
+ Enabled: false
52
55
 
53
56
  Performance/UnfreezeString:
54
57
  Exclude:
@@ -124,10 +127,6 @@ Layout/MultilineAssignmentLayout:
124
127
  StyleGuide: '#indent-conditional-assignment'
125
128
  Enabled: true
126
129
 
127
- Lint/UnneededDisable:
128
- Exclude:
129
- - 'spec/fixtures/**/*'
130
-
131
130
  Lint/MissingCopEnableDirective:
132
131
  Exclude:
133
132
  - 'spec/fixtures/**/*'
data/danger-wcc.gemspec CHANGED
@@ -1,7 +1,6 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
5
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
5
  require 'version'
7
6
 
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DangerWCC
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  class CommitCheck
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  class EmptyLineCheck < CommitCheck
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  class SubjectCapCheck < CommitCheck
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  class SubjectLengthCheck < CommitCheck
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  class SubjectPeriodCheck < CommitCheck
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  class SubjectWordsCheck < CommitCheck
@@ -23,10 +23,10 @@ DuplicateMethodCall:
23
23
  allow_calls: []
24
24
  FeatureEnvy:
25
25
  enabled: true
26
- exclude: []
26
+ exclude: ["Helper"]
27
27
  InstanceVariableAssumption:
28
28
  enabled: true
29
- exclude: []
29
+ exclude: ["Controller"]
30
30
  IrresponsibleModule:
31
31
  enabled: false
32
32
  exclude: []
@@ -54,7 +54,7 @@ NestedIterators:
54
54
  ignore_iterators:
55
55
  - tap
56
56
  NilCheck:
57
- enabled: true
57
+ enabled: false
58
58
  exclude: []
59
59
  PrimaDonnaMethod:
60
60
  enabled: true
@@ -70,15 +70,15 @@ Syntax:
70
70
  enabled: true
71
71
  exclude: []
72
72
  TooManyConstants:
73
- enabled: false
73
+ enabled: true
74
74
  exclude: []
75
75
  max_constants: 5
76
76
  TooManyInstanceVariables:
77
- enabled: false
77
+ enabled: true
78
78
  exclude: []
79
79
  max_instance_variables: 5
80
80
  TooManyMethods:
81
- enabled: false
81
+ enabled: true
82
82
  exclude: []
83
83
  max_methods: 15
84
84
  TooManyStatements:
@@ -127,5 +127,5 @@ UnusedPrivateMethod:
127
127
  exclude: []
128
128
  UtilityFunction:
129
129
  enabled: true
130
- exclude: []
131
- public_methods_only: false
130
+ exclude: ["Helper", "util"]
131
+ public_methods_only: true
data/lib/wcc/utils.rb CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  require 'git_diff'
@@ -102,12 +101,10 @@ module Utils
102
101
  def with_revision(revision)
103
102
  Dir.mktmpdir do |dir|
104
103
  logger.debug "Checking out revision #{revision} into #{dir}"
105
- system "git worktree add #{dir} #{revision.strip}"
104
+ system "git --work-tree=#{dir} checkout #{revision.strip} -- ."
106
105
 
107
106
  yield(dir)
108
107
  end
109
- ensure
110
- system 'git worktree prune'
111
108
  end
112
109
 
113
110
  # Creates a git-format diff of the two strings by writing them to temp files
@@ -1,4 +1,3 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  module FixturesHelper
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'pathname'
4
- ROOT = Pathname.new(File.expand_path('../../', __FILE__))
4
+ ROOT = Pathname.new(File.expand_path('..', __dir__))
5
5
  $LOAD_PATH.unshift((ROOT + 'lib').to_s)
6
6
  $LOAD_PATH.unshift((ROOT + 'spec').to_s)
7
7
 
@@ -4,7 +4,7 @@
4
4
  # https://github.com/jonallured/danger-commit_lint
5
5
  # which is licensed under the MIT License
6
6
 
7
- require File.expand_path('../../spec_helper', __FILE__)
7
+ require File.expand_path('../spec_helper', __dir__)
8
8
 
9
9
  TEST_MESSAGES = {
10
10
  subject_cap: 'this subject needs a capital',
@@ -24,8 +24,6 @@ NOOP_MESSAGE = Danger::DangerWCC::CommitLint::NOOP_MESSAGE
24
24
  SUBJECT_LENGTH_CHECK_MESSAGE = 'Please limit commit subject line to 50 '\
25
25
  'characters.'
26
26
 
27
- # rubocop:enable Metrics/LineLength
28
-
29
27
  def report_counts(status_report)
30
28
  status_report.values.flatten.count
31
29
  end
@@ -388,5 +386,3 @@ module Danger
388
386
  end
389
387
  end
390
388
  end
391
-
392
- # rubocop:enable Metrics/ClassLength
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../spec_helper', __FILE__)
3
+ require File.expand_path('../spec_helper', __dir__)
4
4
  require 'webmock'
5
5
 
6
6
  module Danger
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../spec_helper', __FILE__)
3
+ require File.expand_path('../spec_helper', __dir__)
4
4
 
5
5
  module Danger
6
6
  describe Danger::DangerWCC do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../spec_helper', __FILE__)
3
+ require File.expand_path('../spec_helper', __dir__)
4
4
 
5
5
  module Danger
6
6
  describe Danger::DangerWCC do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../spec_helper', __FILE__)
3
+ require File.expand_path('../spec_helper', __dir__)
4
4
 
5
5
  module Danger
6
6
  describe Danger::DangerWCC do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../spec_helper', __FILE__)
3
+ require File.expand_path('../spec_helper', __dir__)
4
4
 
5
5
  module Danger
6
6
  describe Danger::DangerWCC do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../spec_helper', __FILE__)
3
+ require File.expand_path('../spec_helper', __dir__)
4
4
 
5
5
  module Danger
6
6
  describe Danger::DangerWCC do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../../spec_helper', __FILE__)
3
+ require File.expand_path('../spec_helper', __dir__)
4
4
 
5
5
  module Danger
6
6
  describe Danger::DangerWCC do
data/spec/wcc_spec.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../spec_helper', __FILE__)
3
+ require File.expand_path('spec_helper', __dir__)
4
4
 
5
5
  module Danger
6
6
  describe Danger::DangerWCC do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-wcc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2018-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brakeman