netsoft-danger 0.4.2 → 0.5.0

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: 9e08eb241362988d887b622fb6a446e8e76fd5dd93384ef105ea91e073d86737
4
+ data.tar.gz: 3e5c368c2e1b2048abd67b3d781f112ef117b3e1bde28ce58a8dc29a9e8f0f54
5
5
  SHA512:
6
- metadata.gz: dc45dbff4585b2522bed6bfebf6667a717133745913770a4fbe7c6e5ef428e05dde4fc3503cd7da1eab62c2f5c36ab776d6e83da03d3810e1c4a4c4330325a5d
7
- data.tar.gz: 8139e5cb47340d0cfe6b3e416ebc9f41758c40360f52fb124bc89fd7048a4bf757a937187af1e135fe7435ec2bac099272107bc9c14e8ee92a25885099bf1508
6
+ metadata.gz: ce2b4c4f42b58878171a7a990d00155881af9a62d641c992c9edf376df41f6e68a0d95755f6e477ca73ce97d5c2707218697ea46fdd96f5f97cc3d2529ede9fe
7
+ data.tar.gz: b5591601776b74461a67cd573b4ac08ec7e9eb66082e22ee0805195b3a9037ce1a56612da6b5f435686f2ef2a7cc32bda7edc299e6d42380c2bfee0a66f9349b
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,30 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9
9
  ### Changed
10
10
  ### Fixed
11
11
 
12
+ ## [0.5.0]
13
+ ### Changed
14
+ - updated danger to 8.x
15
+
16
+ ## [0.4.5]
17
+ ### Changed
18
+ - remove the "fit left in tests" check
19
+
20
+ ## [0.4.4]
21
+ ### Changed
22
+ - stop pushing to private gem server
23
+
24
+ ## [0.4.3]
25
+ ### Added
26
+ - add brakeman artifact extraction
27
+ ### Changed
28
+ - updated netsoft-rubocop and rubocop config
29
+ - remove old commit message style from checks
30
+ - update PR template
31
+
32
+ ## [0.4.2]
33
+ ### Fixed
34
+ - restrict simplecov version
35
+
12
36
  ## [0.4.1]
13
37
  ### Changed
14
38
  - exclude binary files in the grep calls
@@ -44,4 +68,3 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
44
68
  - package.json checks
45
69
  ### Fixed
46
70
  - requie older version of faraday until octokit is fixed (https://github.com/octokit/octokit.rb/pull/1154)
47
-
data/Dangerfile CHANGED
@@ -16,7 +16,6 @@ end
16
16
  if Dir.exist?('spec')
17
17
  fail('fdescribe left in tests') if `grep -r -I -e '\\bfdescribe\\b' spec/ |grep -v 'danger ok' `.length > 1
18
18
  fail('fcontext left in tests') if `grep -r -I -e '\\bfcontext\\b' spec/ |grep -v 'danger ok' `.length > 1
19
- fail('fit left in tests') if `grep -r -I -e '\\bfit\\b' spec/ | grep -v 'danger ok' `.length > 1
20
19
  fail('ap left in tests') if `grep -r -I -e '\\bap\\b' spec/ | grep -v 'danger ok' `.length > 1
21
20
  fail('puts left in tests') if `grep -r -I -e '\\bputs\\b' spec/ | grep -v 'danger ok' `.length > 1
22
21
  end
@@ -43,16 +42,12 @@ git.commits.each do |c|
43
42
  short = " ( #{c.sha[0..7]} )"
44
43
  has_migrations = c.diff_parent.any? { |f| f.path =~ %r{db/migrate/} }
45
44
  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]+\))?:/)
45
+ has_migration_msg = c.message.match?(/\Amigration(\([A-Za-z]+\))?:/)
48
46
  no_schema_ok = ENV['DANGER_NO_SCHEMA_OK'] || false
49
47
  if has_migrations || has_schema_changes
50
48
  unless has_migration_msg
51
49
  fail 'migration: Schema migration commits needs to be tagged with (migration). e.g. migration(Module): ' + short
52
50
  end
53
- if old_migration_msg
54
- warn 'migration: Please switch to the new conventional commit format.'
55
- end
56
51
  if has_migrations && !has_schema_changes && !no_schema_ok
57
52
  fail 'migration: Please checkin your schema.rb changes with your migration' + short
58
53
  end
@@ -76,15 +71,11 @@ git.commits.each do |c|
76
71
  end
77
72
 
78
73
  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]+\))?:/)
74
+ has_gemfile_msg = c.message.match?(/\Agemfile(\([A-Za-z]+\))?:/)
81
75
  if has_gemfile_changes
82
76
  unless has_gemfile_msg
83
77
  fail 'gemfile: Gemfile commits needs to be tagged with (gemfile). e.g. gemfile(Module): ' + short
84
78
  end
85
- if old_migration_msg
86
- warn 'gemfile: Please switch to the new conventional commit format.'
87
- end
88
79
  if c.diff_parent.any? { |f| f.path !~ /Gemfile|gemspec/ }
89
80
  fail 'gemfile: Gemfile commit contains non-gemfile changes' + short
90
81
  end
@@ -98,15 +89,11 @@ git.commits.each do |c|
98
89
  end
99
90
 
100
91
  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]+\))?:/)
92
+ has_package_msg = c.message.match?(/\Apackage(\([A-Za-z]+\))?:/)
103
93
  if has_package_changes
104
94
  unless has_package_msg
105
95
  fail 'package: Package.json commits needs to be tagged with package. e.g package(Module): ' + short
106
96
  end
107
- if old_package_msg
108
- warn 'package: Please switch to the new conventional commit format.'
109
- end
110
97
  if c.diff_parent.any? { |f| f.path !~ /package\.json|yarn\.lock/ }
111
98
  fail 'package: Package.json commit contains non-package changes' + short
112
99
  end
@@ -127,6 +114,7 @@ if ENV['CIRCLE_TOKEN']
127
114
  coverage = artifacts.find { |artifact| artifact.end_with?('coverage/index.html') }
128
115
  rubocop = artifacts.find { |artifact| artifact.end_with?('rubocop/report.html') }
129
116
  eslint = artifacts.find { |artifact| artifact.end_with?('eslint/report.html') }
117
+ brakeman = artifacts.find { |artifact| artifact.end_with?('brakeman/report.html') }
130
118
  rspec_files = artifacts.select { |artifact| artifact =~ /rspec-(.+)\.html$/ }
131
119
 
132
120
  {}.tap do |hash|
@@ -135,6 +123,7 @@ if ENV['CIRCLE_TOKEN']
135
123
  hash['RuboCop inspection report'] = rubocop if rubocop
136
124
  hash['ESLint inspection report'] = eslint if eslint
137
125
  hash['Jest coverage report'] = jest if jest
126
+ hash['Brakeman issues report'] = brakeman if brakeman
138
127
  end.each do |msg, links|
139
128
  links = [*links]
140
129
  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.5.0'
5
5
  end
@@ -13,19 +13,19 @@ Gem::Specification.new do |s|
13
13
  s.description = 'Packages a Dangerfile to be used with Danger.'
14
14
  s.executables << 'netsoft-circle'
15
15
 
16
- s.files = `git ls-files`.split("\n")
16
+ s.files = `git ls-files`.split("\n").reject { |f|
17
+ f.match?(%r{^\.github/}i)
18
+ }
17
19
  s.require_paths = ['lib']
18
20
 
19
- s.add_runtime_dependency 'danger', '~> 5.0'
21
+ s.required_ruby_version = '>= 2.4'
22
+
23
+ s.add_runtime_dependency 'danger', '~> 8.0'
20
24
  s.add_runtime_dependency 'faraday'
21
25
  s.add_runtime_dependency 'simplecov', '~> 0.20.0'
22
26
  s.add_runtime_dependency 'thor'
23
27
 
24
28
  s.add_development_dependency 'rake'
25
29
 
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'
30
+ s.add_development_dependency 'netsoft-rubocop', '= 1.1.2'
31
31
  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.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - urkle
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-05 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '8.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '8.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -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:
@@ -157,7 +101,6 @@ executables:
157
101
  extensions: []
158
102
  extra_rdoc_files: []
159
103
  files:
160
- - ".circleci/config.yml"
161
104
  - ".gitignore"
162
105
  - ".rubocop.yml"
163
106
  - CHANGELOG.md
@@ -178,7 +121,7 @@ files:
178
121
  homepage: https://github.com/NetsoftHoldings/danger
179
122
  licenses: []
180
123
  metadata: {}
181
- post_install_message:
124
+ post_install_message:
182
125
  rdoc_options: []
183
126
  require_paths:
184
127
  - lib
@@ -186,15 +129,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
129
  requirements:
187
130
  - - ">="
188
131
  - !ruby/object:Gem::Version
189
- version: '0'
132
+ version: '2.4'
190
133
  required_rubygems_version: !ruby/object:Gem::Requirement
191
134
  requirements:
192
135
  - - ">="
193
136
  - !ruby/object:Gem::Version
194
137
  version: '0'
195
138
  requirements: []
196
- rubygems_version: 3.0.3
197
- signing_key:
139
+ rubygems_version: 3.0.8
140
+ signing_key:
198
141
  specification_version: 4
199
142
  summary: Danger.systems conventions for Netsoft projects.
200
143
  test_files: []
data/.circleci/config.yml DELETED
@@ -1,136 +0,0 @@
1
- version: 2
2
-
3
- defaults: &defaults
4
- docker: &ruby_image
5
- - &ruby_image
6
- image: circleci/ruby:2.5.5-stretch
7
- environment:
8
- RUBYOPT: '-KU -E utf-8:utf-8'
9
- BUNDLE_PATH: vendor/bundle
10
- BUNDLE_VERSION: 1.17.3
11
- BUNDLE_JOBS: 4
12
- BUNDLE_RETRY: 3
13
-
14
- filters:
15
- test: &filter_test
16
- filters:
17
- tags:
18
- ignore: /^v.*/
19
- beta: &filter_beta
20
- filters:
21
- branches:
22
- ignore: /.*/
23
- tags:
24
- only: /^v[0-9]+(\.[0-9]+)+(\.[a-z].+).*/
25
- release: &filter_release
26
- filters:
27
- branches:
28
- ignore: /.*/
29
- tags:
30
- only: /^v[0-9]+(\.[0-9]+)+/
31
-
32
- workflows:
33
- version: 2
34
- build_test:
35
- jobs:
36
- - "Checkout":
37
- <<: *filter_test
38
- context: org-global
39
- - "Build":
40
- <<: *filter_test
41
- context: org-global
42
- requires:
43
- - "Checkout"
44
- build_test_beta:
45
- jobs:
46
- - "Checkout":
47
- <<: *filter_beta
48
- context: org-global
49
- - "Build":
50
- <<: *filter_beta
51
- context: org-global
52
- requires:
53
- - "Checkout"
54
- - "Publish":
55
- <<: *filter_beta
56
- context: org-global
57
- requires:
58
- - "Build"
59
- build_test_release:
60
- jobs:
61
- - "Checkout":
62
- <<: *filter_release
63
- context: org-global
64
- - "Build":
65
- <<: *filter_release
66
- context: org-global
67
- requires:
68
- - "Checkout"
69
- - "Publish":
70
- <<: *filter_release
71
- context: org-global
72
- requires:
73
- - "Build"
74
-
75
- jobs:
76
- "Checkout":
77
- <<: *defaults
78
- steps:
79
- - attach_workspace:
80
- at: .
81
- - checkout
82
-
83
- - restore_cache:
84
- keys:
85
- - netsoft-danger-bundle-v3-{{ checksum "Gemfile" }}-{{ checksum "netsoft-danger.gemspec" }}
86
- - run:
87
- name: Install bundler
88
- command: gem install bundler --version=$BUNDLE_VERSION
89
- - run:
90
- name: Bundle Install
91
- command: |-
92
- bundle _${BUNDLE_VERSION}_ check || bundle _${BUNDLE_VERSION}_ install --retry=$BUNDLE_RETRY
93
- - save_cache:
94
- key: netsoft-danger-bundle-v3-{{ checksum "Gemfile" }}-{{ checksum "netsoft-danger.gemspec" }}
95
- paths:
96
- - vendor/bundle
97
- - Gemfile.lock
98
-
99
- - persist_to_workspace:
100
- root: .
101
- paths: .
102
- "Build":
103
- <<: *defaults
104
- steps:
105
- - attach_workspace:
106
- at: .
107
- - run:
108
- name: Install bundler
109
- command: gem install bundler --version=$BUNDLE_VERSION
110
- - run:
111
- name: Build gem
112
- command: |-
113
- gem build *.gemspec
114
- - run:
115
- name: Run rubocop
116
- command: |-
117
- bundle exec rubocop
118
- - run:
119
- name: Run Danger
120
- command: |-
121
- bundle exec danger
122
- "Publish":
123
- <<: *defaults
124
- steps:
125
- - attach_workspace:
126
- at: .
127
- - run:
128
- name: Deploy to gem server
129
- command: |-
130
- ./bin/tag_check.sh
131
- ./bin/setup-rubygems.sh
132
- rm -rf pkg
133
- gem install geminabox
134
- rake build
135
- gem inabox -g ${HUBSTAFF_GEM_SERVER} pkg/*
136
- gem push pkg/*.gem