netsoft-danger 0.4.2 → 0.4.3

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
  SHA256:
3
- metadata.gz: 0c1bb297084211ee73b3610e83d81c606dfc91b766b0f27c85039e4a60356d4a
4
- data.tar.gz: e04cb0d0da8aee130efd829b14699e578276c1034e1530ccc482065bea14f803
3
+ metadata.gz: e6d63752b34b78d9c1c5f2527140833504efec1a06f2b1d28addfb24f2e403b6
4
+ data.tar.gz: 329482a85420c77b166e255ef01e8fe080c40acdfe00d8e86c86b3b1af80aeb0
5
5
  SHA512:
6
- metadata.gz: dc45dbff4585b2522bed6bfebf6667a717133745913770a4fbe7c6e5ef428e05dde4fc3503cd7da1eab62c2f5c36ab776d6e83da03d3810e1c4a4c4330325a5d
7
- data.tar.gz: 8139e5cb47340d0cfe6b3e416ebc9f41758c40360f52fb124bc89fd7048a4bf757a937187af1e135fe7435ec2bac099272107bc9c14e8ee92a25885099bf1508
6
+ metadata.gz: 1a4ffb45c808ad945619ddae8d5805e02066fbc1006d3bf31ba23581312840819f4868f2fcbb2bf7557c68954005299a6d496e5ddf106329b0c8a3afe51aaa16
7
+ data.tar.gz: 3908944e5a0f1c246b83caaf40c73db44a1b9672b191cb022d59c34fff7f8b2e913f14c2abaf12942bf75065bb68e78f74cad86c896cce397fe590f6f284808e
@@ -0,0 +1,25 @@
1
+ ## Change description
2
+
3
+ > Please include a summary of the change and which issue is fixed. Please also include
4
+ relevant motivation and context. List any dependencies that are required for this change.
5
+
6
+ ## Related issues
7
+
8
+ - Source: <Issue link or Spec Link>
9
+ - UAT: <UAT Link>
10
+ - QA: <QA Task Link here>
11
+ - Review app: <Link to Heroku>
12
+
13
+ ## Checklists
14
+
15
+ ### Development
16
+
17
+ - [ ] The commit message follows our guidelines
18
+ - [ ] I have performed a self-review of my own code
19
+ - [ ] I have thoroughly tested the changes
20
+ - [ ] I have added tests that prove my fix is effective or that my feature works
21
+
22
+ ### Security
23
+
24
+ - [ ] Security impact of change has been considered
25
+
data/.rubocop.yml CHANGED
@@ -1,6 +1,9 @@
1
1
  inherit_gem:
2
2
  netsoft-rubocop:
3
- - default.yml
3
+ - config/default.yml
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.4
4
7
 
5
8
  Style/SignalException:
6
9
  Exclude:
@@ -10,6 +13,19 @@ Style/IfUnlessModifier:
10
13
  Exclude:
11
14
  - Dangerfile
12
15
 
16
+ Style/SoleNestedConditional:
17
+ Exclude:
18
+ - Dangerfile
19
+
13
20
  Layout/EmptyLineAfterGuardClause:
14
21
  Exclude:
15
- - Dangerfile
22
+ - Dangerfile
23
+
24
+ Layout/LineLength:
25
+ Exclude:
26
+ - Dangerfile
27
+
28
+ Performance/StringInclude:
29
+ Exclude:
30
+ - Dangerfile
31
+
data/CHANGELOG.md CHANGED
@@ -9,6 +9,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9
9
  ### Changed
10
10
  ### Fixed
11
11
 
12
+ ## [0.4.3]
13
+ ### Added
14
+ - add brakeman artifact extraction
15
+ ### Changed
16
+ - updated netsoft-rubocop and rubocop config
17
+ - remove old commit message style from checks
18
+ - update PR template
19
+
20
+ ## [0.4.2]
21
+ ### Fixed
22
+ - restrict simplecov version
23
+
12
24
  ## [0.4.1]
13
25
  ### Changed
14
26
  - exclude binary files in the grep calls
data/Dangerfile CHANGED
@@ -43,16 +43,12 @@ git.commits.each do |c|
43
43
  short = " ( #{c.sha[0..7]} )"
44
44
  has_migrations = c.diff_parent.any? { |f| f.path =~ %r{db/migrate/} }
45
45
  has_schema_changes = c.diff_parent.any? { |f| f.path =~ %r{db/schema\.rb} }
46
- old_migration_msg = c.message.start_with?('[migration]')
47
- has_migration_msg = old_migration_msg || c.message.match?(/\Amigration(\([A-Za-z]+\))?:/)
46
+ has_migration_msg = c.message.match?(/\Amigration(\([A-Za-z]+\))?:/)
48
47
  no_schema_ok = ENV['DANGER_NO_SCHEMA_OK'] || false
49
48
  if has_migrations || has_schema_changes
50
49
  unless has_migration_msg
51
50
  fail 'migration: Schema migration commits needs to be tagged with (migration). e.g. migration(Module): ' + short
52
51
  end
53
- if old_migration_msg
54
- warn 'migration: Please switch to the new conventional commit format.'
55
- end
56
52
  if has_migrations && !has_schema_changes && !no_schema_ok
57
53
  fail 'migration: Please checkin your schema.rb changes with your migration' + short
58
54
  end
@@ -76,15 +72,11 @@ git.commits.each do |c|
76
72
  end
77
73
 
78
74
  has_gemfile_changes = c.diff_parent.any? { |f| f.path =~ /Gemfile|gemspec/ }
79
- old_gemfile_msg = c.message.start_with?('[gemfile]')
80
- has_gemfile_msg = old_gemfile_msg || c.message.match?(/\Agemfile(\([A-Za-z]+\))?:/)
75
+ has_gemfile_msg = c.message.match?(/\Agemfile(\([A-Za-z]+\))?:/)
81
76
  if has_gemfile_changes
82
77
  unless has_gemfile_msg
83
78
  fail 'gemfile: Gemfile commits needs to be tagged with (gemfile). e.g. gemfile(Module): ' + short
84
79
  end
85
- if old_migration_msg
86
- warn 'gemfile: Please switch to the new conventional commit format.'
87
- end
88
80
  if c.diff_parent.any? { |f| f.path !~ /Gemfile|gemspec/ }
89
81
  fail 'gemfile: Gemfile commit contains non-gemfile changes' + short
90
82
  end
@@ -98,15 +90,11 @@ git.commits.each do |c|
98
90
  end
99
91
 
100
92
  has_package_changes = c.diff_parent.any? { |f| f.path =~ /package\.json|yarn\.lock/ }
101
- old_package_msg = c.message.start_with?('[package.json]')
102
- has_package_msg = old_package_msg || c.message.match?(/\Apackage(\([A-Za-z]+\))?:/)
93
+ has_package_msg = c.message.match?(/\Apackage(\([A-Za-z]+\))?:/)
103
94
  if has_package_changes
104
95
  unless has_package_msg
105
96
  fail 'package: Package.json commits needs to be tagged with package. e.g package(Module): ' + short
106
97
  end
107
- if old_package_msg
108
- warn 'package: Please switch to the new conventional commit format.'
109
- end
110
98
  if c.diff_parent.any? { |f| f.path !~ /package\.json|yarn\.lock/ }
111
99
  fail 'package: Package.json commit contains non-package changes' + short
112
100
  end
@@ -127,6 +115,7 @@ if ENV['CIRCLE_TOKEN']
127
115
  coverage = artifacts.find { |artifact| artifact.end_with?('coverage/index.html') }
128
116
  rubocop = artifacts.find { |artifact| artifact.end_with?('rubocop/report.html') }
129
117
  eslint = artifacts.find { |artifact| artifact.end_with?('eslint/report.html') }
118
+ brakeman = artifacts.find { |artifact| artifact.end_with?('brakeman/report.html') }
130
119
  rspec_files = artifacts.select { |artifact| artifact =~ /rspec-(.+)\.html$/ }
131
120
 
132
121
  {}.tap do |hash|
@@ -135,6 +124,7 @@ if ENV['CIRCLE_TOKEN']
135
124
  hash['RuboCop inspection report'] = rubocop if rubocop
136
125
  hash['ESLint inspection report'] = eslint if eslint
137
126
  hash['Jest coverage report'] = jest if jest
127
+ hash['Brakeman issues report'] = brakeman if brakeman
138
128
  end.each do |msg, links|
139
129
  links = [*links]
140
130
  if links.size == 1
data/bin/netsoft-circle CHANGED
@@ -34,7 +34,9 @@ class NetsoftCircle < Thor # :nodoc:
34
34
  end
35
35
 
36
36
  desc 'merge', 'Merges several simplecov json result files'
37
- option :output, type: :string, aliases: '-o', desc: 'Specify an alternate output directory for the produced coverage data'
37
+ option :output, type: :string, aliases: '-o',
38
+ desc: 'Specify an alternate output directory for the produced coverage data'
39
+
38
40
  def merge(*files)
39
41
  require 'simplecov'
40
42
  return if files.empty?
@@ -81,6 +83,15 @@ class NetsoftCircle < Thor # :nodoc:
81
83
  exit(1) unless $CHILD_STATUS.success?
82
84
  end
83
85
 
86
+ desc 'brakeman', 'Run brakeman'
87
+ def brakeman
88
+ system <<~COMMAND
89
+ bundle _${BUNDLE_VERSION}_ exec brakeman \
90
+ -o $CIRCLE_ARTIFACTS/brakeman/report.html
91
+ COMMAND
92
+ exit(1) unless $CHILD_STATUS.success?
93
+ end
94
+
84
95
  def self.exit_on_failure?
85
96
  true
86
97
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NetsoftDanger
4
- VERSION = '0.4.2'
4
+ VERSION = '0.4.3'
5
5
  end
@@ -16,6 +16,8 @@ Gem::Specification.new do |s|
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.require_paths = ['lib']
18
18
 
19
+ s.required_ruby_version = '>= 2.4'
20
+
19
21
  s.add_runtime_dependency 'danger', '~> 5.0'
20
22
  s.add_runtime_dependency 'faraday'
21
23
  s.add_runtime_dependency 'simplecov', '~> 0.20.0'
@@ -23,9 +25,5 @@ Gem::Specification.new do |s|
23
25
 
24
26
  s.add_development_dependency 'rake'
25
27
 
26
- s.add_development_dependency 'netsoft-rubocop', '= 1.0.1'
27
- s.add_development_dependency 'rubocop', '= 0.74.0'
28
- s.add_development_dependency 'rubocop-performance', '= 1.5.2'
29
- s.add_development_dependency 'rubocop-rails', '= 2.4.2'
30
- s.add_development_dependency 'rubocop-rspec', '= 1.38.1'
28
+ s.add_development_dependency 'netsoft-rubocop', '= 1.1.2'
31
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsoft-danger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - urkle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-05 00:00:00.000000000 Z
11
+ date: 2021-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger
@@ -86,70 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 1.0.1
89
+ version: 1.1.2
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 1.0.1
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '='
102
- - !ruby/object:Gem::Version
103
- version: 0.74.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - '='
109
- - !ruby/object:Gem::Version
110
- version: 0.74.0
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop-performance
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '='
116
- - !ruby/object:Gem::Version
117
- version: 1.5.2
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '='
123
- - !ruby/object:Gem::Version
124
- version: 1.5.2
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop-rails
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - '='
130
- - !ruby/object:Gem::Version
131
- version: 2.4.2
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - '='
137
- - !ruby/object:Gem::Version
138
- version: 2.4.2
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop-rspec
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - '='
144
- - !ruby/object:Gem::Version
145
- version: 1.38.1
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - '='
151
- - !ruby/object:Gem::Version
152
- version: 1.38.1
96
+ version: 1.1.2
153
97
  description: Packages a Dangerfile to be used with Danger.
154
98
  email: []
155
99
  executables:
@@ -158,6 +102,7 @@ extensions: []
158
102
  extra_rdoc_files: []
159
103
  files:
160
104
  - ".circleci/config.yml"
105
+ - ".github/PULL_REQUEST_TEMPLATE.txt"
161
106
  - ".gitignore"
162
107
  - ".rubocop.yml"
163
108
  - CHANGELOG.md
@@ -186,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
131
  requirements:
187
132
  - - ">="
188
133
  - !ruby/object:Gem::Version
189
- version: '0'
134
+ version: '2.4'
190
135
  required_rubygems_version: !ruby/object:Gem::Requirement
191
136
  requirements:
192
137
  - - ">="