netsoft-danger 0.4.1 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +4 -6
- data/.github/PULL_REQUEST_TEMPLATE.md +24 -0
- data/.github/PULL_REQUEST_TEMPLATE.txt +25 -0
- data/.rubocop.yml +18 -2
- data/CHANGELOG.md +20 -1
- data/Dangerfile +5 -16
- data/bin/netsoft-circle +12 -1
- data/lib/netsoft-danger/version.rb +1 -1
- data/netsoft-danger.gemspec +4 -5
- metadata +21 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5698456c6bddb5523173ef86d53f2aec5416f7550c0ea28ab685534796b393e
|
4
|
+
data.tar.gz: 1dd2c88b77d0f8028287cebb55053f297f688341aa03646cb2cbdf8983da430d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac11210176e7a4f09fc128548e0f4aa9a25e65c61112afdbce32c78db9d279cebf495e58e6bcd6668cdb7e0d71e83a04bea8ad0649feb8752070f482cef6535
|
7
|
+
data.tar.gz: 925d7666da1126663754db412bdf7f0547e30bbacffe7f59ca81751def2b500a1e1d6bc5aefb8ce4a60b88e27a72eed767a36329255100f0d6d28a9f7dabb917
|
data/.circleci/config.yml
CHANGED
@@ -3,11 +3,11 @@ version: 2
|
|
3
3
|
defaults: &defaults
|
4
4
|
docker: &ruby_image
|
5
5
|
- &ruby_image
|
6
|
-
image: circleci/ruby:2.
|
6
|
+
image: circleci/ruby:2.5.5-stretch
|
7
7
|
environment:
|
8
8
|
RUBYOPT: '-KU -E utf-8:utf-8'
|
9
9
|
BUNDLE_PATH: vendor/bundle
|
10
|
-
BUNDLE_VERSION: 1.
|
10
|
+
BUNDLE_VERSION: 1.17.3
|
11
11
|
BUNDLE_JOBS: 4
|
12
12
|
BUNDLE_RETRY: 3
|
13
13
|
|
@@ -82,7 +82,7 @@ jobs:
|
|
82
82
|
|
83
83
|
- restore_cache:
|
84
84
|
keys:
|
85
|
-
- netsoft-danger-bundle-
|
85
|
+
- netsoft-danger-bundle-v3-{{ checksum "Gemfile" }}-{{ checksum "netsoft-danger.gemspec" }}
|
86
86
|
- run:
|
87
87
|
name: Install bundler
|
88
88
|
command: gem install bundler --version=$BUNDLE_VERSION
|
@@ -91,7 +91,7 @@ jobs:
|
|
91
91
|
command: |-
|
92
92
|
bundle _${BUNDLE_VERSION}_ check || bundle _${BUNDLE_VERSION}_ install --retry=$BUNDLE_RETRY
|
93
93
|
- save_cache:
|
94
|
-
key: netsoft-danger-bundle-
|
94
|
+
key: netsoft-danger-bundle-v3-{{ checksum "Gemfile" }}-{{ checksum "netsoft-danger.gemspec" }}
|
95
95
|
paths:
|
96
96
|
- vendor/bundle
|
97
97
|
- Gemfile.lock
|
@@ -130,7 +130,5 @@ jobs:
|
|
130
130
|
./bin/tag_check.sh
|
131
131
|
./bin/setup-rubygems.sh
|
132
132
|
rm -rf pkg
|
133
|
-
gem install geminabox
|
134
133
|
rake build
|
135
|
-
gem inabox -g ${HUBSTAFF_GEM_SERVER} pkg/*
|
136
134
|
gem push pkg/*.gem
|
@@ -0,0 +1,24 @@
|
|
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](https://docs.hubstaff.com/hubstaff-docs/latest/great_commit_messages.html)
|
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
|
@@ -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,26 @@ 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.5]
|
13
|
+
### Changed
|
14
|
+
- remove the "fit left in tests" check
|
15
|
+
|
16
|
+
## [0.4.4]
|
17
|
+
### Changed
|
18
|
+
- stop pushing to private gem server
|
19
|
+
|
20
|
+
## [0.4.3]
|
21
|
+
### Added
|
22
|
+
- add brakeman artifact extraction
|
23
|
+
### Changed
|
24
|
+
- updated netsoft-rubocop and rubocop config
|
25
|
+
- remove old commit message style from checks
|
26
|
+
- update PR template
|
27
|
+
|
28
|
+
## [0.4.2]
|
29
|
+
### Fixed
|
30
|
+
- restrict simplecov version
|
31
|
+
|
12
32
|
## [0.4.1]
|
13
33
|
### Changed
|
14
34
|
- exclude binary files in the grep calls
|
@@ -44,4 +64,3 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
44
64
|
- package.json checks
|
45
65
|
### Fixed
|
46
66
|
- 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
|
-
|
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
|
-
|
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
|
-
|
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',
|
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
|
data/netsoft-danger.gemspec
CHANGED
@@ -16,15 +16,14 @@ 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'
|
23
|
+
s.add_runtime_dependency 'simplecov', '~> 0.20.0'
|
21
24
|
s.add_runtime_dependency 'thor'
|
22
25
|
|
23
26
|
s.add_development_dependency 'rake'
|
24
27
|
|
25
|
-
s.add_development_dependency 'netsoft-rubocop', '= 1.
|
26
|
-
s.add_development_dependency 'rubocop', '= 0.74.0'
|
27
|
-
s.add_development_dependency 'rubocop-performance', '= 1.5.2'
|
28
|
-
s.add_development_dependency 'rubocop-rails', '= 2.4.2'
|
29
|
-
s.add_development_dependency 'rubocop-rspec', '= 1.38.1'
|
28
|
+
s.add_development_dependency 'netsoft-rubocop', '= 1.1.2'
|
30
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.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- urkle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger
|
@@ -39,27 +39,27 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: simplecov
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.20.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.20.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: thor
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
type: :
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
@@ -67,75 +67,33 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - '='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.0.1
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - '='
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 1.0.1
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.74.0
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 0.74.0
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop-performance
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - '='
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 1.5.2
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - '='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 1.5.2
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop-rails
|
70
|
+
name: rake
|
113
71
|
requirement: !ruby/object:Gem::Requirement
|
114
72
|
requirements:
|
115
|
-
- -
|
73
|
+
- - ">="
|
116
74
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
75
|
+
version: '0'
|
118
76
|
type: :development
|
119
77
|
prerelease: false
|
120
78
|
version_requirements: !ruby/object:Gem::Requirement
|
121
79
|
requirements:
|
122
|
-
- -
|
80
|
+
- - ">="
|
123
81
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
82
|
+
version: '0'
|
125
83
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop
|
84
|
+
name: netsoft-rubocop
|
127
85
|
requirement: !ruby/object:Gem::Requirement
|
128
86
|
requirements:
|
129
87
|
- - '='
|
130
88
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
89
|
+
version: 1.1.2
|
132
90
|
type: :development
|
133
91
|
prerelease: false
|
134
92
|
version_requirements: !ruby/object:Gem::Requirement
|
135
93
|
requirements:
|
136
94
|
- - '='
|
137
95
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
96
|
+
version: 1.1.2
|
139
97
|
description: Packages a Dangerfile to be used with Danger.
|
140
98
|
email: []
|
141
99
|
executables:
|
@@ -144,6 +102,8 @@ extensions: []
|
|
144
102
|
extra_rdoc_files: []
|
145
103
|
files:
|
146
104
|
- ".circleci/config.yml"
|
105
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
106
|
+
- ".github/PULL_REQUEST_TEMPLATE.txt"
|
147
107
|
- ".gitignore"
|
148
108
|
- ".rubocop.yml"
|
149
109
|
- CHANGELOG.md
|
@@ -172,15 +132,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
132
|
requirements:
|
173
133
|
- - ">="
|
174
134
|
- !ruby/object:Gem::Version
|
175
|
-
version: '
|
135
|
+
version: '2.4'
|
176
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
137
|
requirements:
|
178
138
|
- - ">="
|
179
139
|
- !ruby/object:Gem::Version
|
180
140
|
version: '0'
|
181
141
|
requirements: []
|
182
|
-
|
183
|
-
rubygems_version: 2.7.7
|
142
|
+
rubygems_version: 3.0.3
|
184
143
|
signing_key:
|
185
144
|
specification_version: 4
|
186
145
|
summary: Danger.systems conventions for Netsoft projects.
|