shuttlerock_shared_config 0.2.18 → 0.2.19

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: cc28184cdb5efd70f3cb5b8cfaa51a7268fbc14edd85e4b35d0a5b0214d7a00a
4
- data.tar.gz: e934a006b3ae67c4d5cf3b5136d41974fbcc77b4ea8ab196b7f2c0c85d1f444c
3
+ metadata.gz: 0d2fe5519b33aaad8e21ab977bc4a205177b39994996cd616e64f535be6a5224
4
+ data.tar.gz: d1a8ff7520dfdfbc940f2d271e086c69b46da8b772f2a8de7f7c784fbdcb0b44
5
5
  SHA512:
6
- metadata.gz: ca400326f5bbfafc1d0e38f6cb0a934d901bfc10e5c1a6e42952d14cca84fa8dba1a9265bf31833f1650d0a561918e51b9d55ed0fb5432cae3011386c482b4be
7
- data.tar.gz: 6d26ddcba2b2d8c39a24445a50e541357014638969e22b468654c19113599f3bc40acf6ae7ec1bb36f7cb7152f416e8d72f24db7e8d91168848c14096ee429aa
6
+ metadata.gz: d69205001d783536ac4d9f625119f5601de297c861c9fc51ed4a5fceed196c07d5fd5eedfa45752f78883a713ac54bc34788987c81e2300a426a924034033028
7
+ data.tar.gz: ea9f1a5e3300c7bf19fa4472a3649174a3754dd820ba8d00d7c2cc5612178a9e6647fa762eb14dd50ecf11d1407a5f85a446727f756a2458098ebaeaf56963cc
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShuttlerockSharedConfig
4
- VERSION = '0.2.18'
4
+ VERSION = '0.2.19'
5
5
  end
data/lib/tasks/tasks.rb CHANGED
@@ -4,30 +4,53 @@ require 'rake'
4
4
  require 'fileutils'
5
5
 
6
6
  namespace :shuttlerock_shared_config do
7
- task update: %i[update_codeclimate update_eslint update_rubocop update_stylelintrc] do
7
+ task update: %i[update_codeclimate update_eslint update_rubocop update_stylelintrc update_dangerfile] do
8
8
  end
9
9
 
10
10
  desc 'Update .codeclimate.yml'
11
11
  task :update_codeclimate do
12
12
  input_path = File.expand_path('../../lib/templates/.codeclimate.yml', __dir__)
13
13
  FileUtils.copy(input_path, Dir.pwd)
14
+ warn('Updated .codeclimate.yml')
14
15
  end
15
16
 
16
17
  desc 'Update .eslintrc'
17
18
  task :update_eslint do
18
19
  input_path = File.expand_path('../../lib/templates/.eslintrc', __dir__)
19
20
  FileUtils.copy(input_path, Dir.pwd)
21
+ warn('Updated .eslintrc')
20
22
  end
21
23
 
22
24
  desc 'Update .rubocop.yml'
23
25
  task :update_rubocop do
24
26
  input_path = File.expand_path('../../lib/templates/.rubocop.yml', __dir__)
25
27
  FileUtils.copy(input_path, Dir.pwd)
28
+ warn('Updated .rubocop.yml')
26
29
  end
27
30
 
28
31
  desc 'Update .stylelintrc'
29
32
  task :update_stylelintrc do
30
33
  input_path = File.expand_path('../../lib/templates/.stylelintrc', __dir__)
31
34
  FileUtils.copy(input_path, Dir.pwd)
35
+ warn('Updated .stylelintrc')
36
+ end
37
+
38
+ desc 'Update Dangerfile'
39
+ task :update_dangerfile do
40
+ input_path = File.expand_path('../../lib/templates/Dangerfile', __dir__)
41
+ FileUtils.copy(input_path, Dir.pwd)
42
+ warn("Updated .Dangerfile\n" \
43
+ "WARNING!!!\n" \
44
+ "For danger.gem to work correctly, you need to add settings to:\n" \
45
+ ".circleci/config.yml, doc/env_list.yml")
46
+ input_path = File.expand_path('../../lib/templates/.env.example', __dir__)
47
+ FileUtils.copy(input_path, Dir.pwd)
48
+ input_path = File.expand_path('../../lib/templates/env_list.yml', __dir__)
49
+ result_dir = Dir.pwd + '/doc'
50
+ unless File.exist?(Dir.pwd + '/doc/env_list.yml')
51
+ FileUtils.mkdir_p(result_dir)
52
+ FileUtils.copy(input_path, result_dir)
53
+ warn('Created /doc/env_list.yml')
54
+ end
32
55
  end
33
56
  end
@@ -0,0 +1 @@
1
+ MY_ENV_VAR='value'
@@ -0,0 +1,23 @@
1
+ # Warn when there is a big PR
2
+ warn('Big PR') if git.lines_of_code > 500
3
+
4
+ # Make sure that and new ENV files are recorded in /doc/env_list.yml
5
+ documented_env = YAML.load_file('doc/env_list.yml').keys
6
+
7
+ git.diff.each do |chunk|
8
+ chunk.patch.lines.grep(/^+/).each do |added_line|
9
+ env_variable = (added_line.match(/ENV\[(\S+)\]/) || added_line.match(/ENV.fetch\((\S+)\)/))&.captures&.first.to_s.delete("'").delete('"')
10
+
11
+ next if env_variable.nil? || env_variable.empty?
12
+
13
+ failure("Please add a record of #{env_variable} to doc/env_list.yml") unless documented_env.include?(env_variable)
14
+ end
15
+ end
16
+
17
+ if github.pr_body.include?('EXAMPLE_ENV_VARIABLE')
18
+ warn('Template `Deployment Notes` appears to be unmodified. Please update with relevant information or remove if not required.')
19
+ end
20
+
21
+ if github.pr_body.include?('Do this') && github.pr_body.include?('Do that')
22
+ warn('Template `How to test PR` appears to be unmodified. Please update with relevant information or remove if testing is not required.')
23
+ end
@@ -0,0 +1,6 @@
1
+ # Please update this list with the description of any ENV you know about in the system.
2
+ # I only wrote about the ones I know about personally. But we should add some explanation
3
+ # for future developers.
4
+
5
+ # EXAMPLE_ENV_VARIABLE:
6
+ # description: 'Example description.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shuttlerock_shared_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - ElseThen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-25 00:00:00.000000000 Z
11
+ date: 2019-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.64'
41
+ - !ruby/object:Gem::Dependency
42
+ name: danger
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 6.0.9
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 6.0.9
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -64,9 +78,12 @@ files:
64
78
  - lib/tasks/tasks.rb
65
79
  - lib/tasks/update_eslintrc.js
66
80
  - lib/templates/.codeclimate.yml
81
+ - lib/templates/.env.example
67
82
  - lib/templates/.eslintrc
68
83
  - lib/templates/.rubocop.yml
69
84
  - lib/templates/.stylelintrc
85
+ - lib/templates/Dangerfile
86
+ - lib/templates/env_list.yml
70
87
  homepage: https://github.com/Shuttlerock/shuttlerock_shared_config
71
88
  licenses:
72
89
  - MIT