neeto-compliance 1.0.58
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +10 -0
- data/.husky/helpers/verify_neeto_audit.sh +18 -0
- data/.husky/pre-push +7 -0
- data/.neetoci/neetoci.yml +18 -0
- data/.overcommit.yml +47 -0
- data/.rubocop.yml +596 -0
- data/.ruby-version +1 -0
- data/.semaphore/semaphore.yml +33 -0
- data/CHANGELOG.md +375 -0
- data/Gemfile +36 -0
- data/Gemfile.lock +435 -0
- data/README.md +85 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/neeto-audit +11 -0
- data/bin/neeto_repos_verifier/client_config.json +7 -0
- data/bin/neeto_repos_verifier/list_verifier.rb +93 -0
- data/bin/setup +8 -0
- data/bin/sync-neeto-repos +5 -0
- data/bin/sync-with-neeto-commons +5 -0
- data/config/brakeman.ignore +604 -0
- data/data/neeto_repos.json +295 -0
- data/lib/neeto-compliance.rb +21 -0
- data/lib/neeto_compliance/github_access.rb +29 -0
- data/lib/neeto_compliance/neeto_commons.rb +16 -0
- data/lib/neeto_compliance/neeto_repos.rb +59 -0
- data/lib/neeto_compliance/runner.rb +43 -0
- data/lib/neeto_compliance/skippable.rb +19 -0
- data/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +32 -0
- data/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +28 -0
- data/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +33 -0
- data/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +36 -0
- data/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +38 -0
- data/lib/neeto_compliance/sync_neeto_commons.rb +36 -0
- data/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/base.rb +77 -0
- data/lib/neeto_compliance/verifiers/bump_version_with_pr_label_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +48 -0
- data/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +46 -0
- data/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/environment_config_verifier.rb +38 -0
- data/lib/neeto_compliance/verifiers/gem_version_verifier.rb +33 -0
- data/lib/neeto_compliance/verifiers/gems_verifier_base.rb +44 -0
- data/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +37 -0
- data/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +187 -0
- data/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +42 -0
- data/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +36 -0
- data/lib/neeto_compliance/verifiers/newrelic_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/node_version_verifier.rb +84 -0
- data/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +59 -0
- data/lib/neeto_compliance/verifiers/package_json_verifier.rb +46 -0
- data/lib/neeto_compliance/verifiers/roles_verifier.rb +22 -0
- data/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +74 -0
- data/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +36 -0
- data/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +29 -0
- data/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +29 -0
- data/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +25 -0
- data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +29 -0
- data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +29 -0
- data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +29 -0
- data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +29 -0
- data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +28 -0
- data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +31 -0
- data/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +32 -0
- data/lib/neeto_compliance/verifiers_list.rb +55 -0
- data/lib/neeto_compliance/version.rb +5 -0
- data/neeto-compliance.gemspec +35 -0
- data/package.json +9 -0
- data/yarn.lock +8 -0
- metadata +177 -0
@@ -0,0 +1,295 @@
|
|
1
|
+
{
|
2
|
+
"products": {
|
3
|
+
"neeto-chat-web": {
|
4
|
+
"staging": true,
|
5
|
+
"production": true,
|
6
|
+
"semaphore": true
|
7
|
+
},
|
8
|
+
"neeto-desk-web": {
|
9
|
+
"staging": true,
|
10
|
+
"production": true,
|
11
|
+
"semaphore": true
|
12
|
+
},
|
13
|
+
"neeto-kb-web": {
|
14
|
+
"staging": true,
|
15
|
+
"production": true,
|
16
|
+
"semaphore": true
|
17
|
+
},
|
18
|
+
"neeto-invoice-web": {
|
19
|
+
"staging": true,
|
20
|
+
"production": true,
|
21
|
+
"semaphore": true
|
22
|
+
},
|
23
|
+
"neeto-form-web": {
|
24
|
+
"staging": true,
|
25
|
+
"production": true,
|
26
|
+
"semaphore": true
|
27
|
+
},
|
28
|
+
"neeto-cal-web": {
|
29
|
+
"staging": true,
|
30
|
+
"production": true,
|
31
|
+
"semaphore": true
|
32
|
+
},
|
33
|
+
"neeto-planner-web": {
|
34
|
+
"staging": true,
|
35
|
+
"production": true,
|
36
|
+
"semaphore": true
|
37
|
+
},
|
38
|
+
"neeto-course-web": {
|
39
|
+
"staging": true,
|
40
|
+
"production": true,
|
41
|
+
"semaphore": true
|
42
|
+
},
|
43
|
+
"neeto-runner-web": {
|
44
|
+
"staging": true,
|
45
|
+
"production": true,
|
46
|
+
"semaphore": true
|
47
|
+
},
|
48
|
+
"neeto-social-web": {
|
49
|
+
"staging": true,
|
50
|
+
"production": true,
|
51
|
+
"semaphore": true
|
52
|
+
},
|
53
|
+
"neeto-wireframe-web": {
|
54
|
+
"staging": true,
|
55
|
+
"production": true,
|
56
|
+
"semaphore": true
|
57
|
+
},
|
58
|
+
"neeto-changelog-web": {
|
59
|
+
"staging": true,
|
60
|
+
"production": true,
|
61
|
+
"semaphore": true
|
62
|
+
},
|
63
|
+
"neeto-quiz-web": {
|
64
|
+
"staging": true,
|
65
|
+
"production": true,
|
66
|
+
"semaphore": true
|
67
|
+
},
|
68
|
+
"neeto-site-web": {
|
69
|
+
"staging": true,
|
70
|
+
"production": false,
|
71
|
+
"semaphore": true
|
72
|
+
},
|
73
|
+
"neeto-crm-web": {
|
74
|
+
"staging": true,
|
75
|
+
"production": true,
|
76
|
+
"semaphore": true
|
77
|
+
},
|
78
|
+
"neeto-replay-web": {
|
79
|
+
"staging": true,
|
80
|
+
"production": true,
|
81
|
+
"semaphore": true
|
82
|
+
},
|
83
|
+
"neeto-invisible-web": {
|
84
|
+
"staging": true,
|
85
|
+
"production": false,
|
86
|
+
"semaphore": true
|
87
|
+
},
|
88
|
+
"neeto-testify-web": {
|
89
|
+
"staging": true,
|
90
|
+
"production": true,
|
91
|
+
"semaphore": true
|
92
|
+
},
|
93
|
+
"neeto-deploy-web": {
|
94
|
+
"staging": true,
|
95
|
+
"production": false,
|
96
|
+
"semaphore": true
|
97
|
+
},
|
98
|
+
"neeto-bugtrap-web": {
|
99
|
+
"staging": true,
|
100
|
+
"production": false,
|
101
|
+
"semaphore": true
|
102
|
+
},
|
103
|
+
"neeto-sign-web": {
|
104
|
+
"staging": true,
|
105
|
+
"production": false,
|
106
|
+
"semaphore": true
|
107
|
+
},
|
108
|
+
"neeto-monitor-web": {
|
109
|
+
"staging": true,
|
110
|
+
"production": true,
|
111
|
+
"semaphore": true
|
112
|
+
},
|
113
|
+
"neeto-ci-web": {
|
114
|
+
"staging": true,
|
115
|
+
"production": false,
|
116
|
+
"semaphore": true
|
117
|
+
},
|
118
|
+
"neeto-git-web": {
|
119
|
+
"staging": true,
|
120
|
+
"production": false,
|
121
|
+
"semaphore": true
|
122
|
+
},
|
123
|
+
"neeto-auth-web": {
|
124
|
+
"staging": true,
|
125
|
+
"production": true,
|
126
|
+
"semaphore": true
|
127
|
+
},
|
128
|
+
"neeto-wheel-web": {
|
129
|
+
"staging": false,
|
130
|
+
"production": false,
|
131
|
+
"semaphore": true
|
132
|
+
}
|
133
|
+
},
|
134
|
+
"nanos_frontend": [
|
135
|
+
"neeto-team-members-frontend",
|
136
|
+
"neeto-form-frontend",
|
137
|
+
"neeto-approvals-frontend",
|
138
|
+
"neeto-filters-frontend",
|
139
|
+
"neeto-rules-frontend",
|
140
|
+
"neeto-tags-frontend",
|
141
|
+
"neeto-commons-frontend",
|
142
|
+
"eslint-plugin-neeto",
|
143
|
+
"neeto-ui",
|
144
|
+
"neeto-icons",
|
145
|
+
"neeto-icons-doc",
|
146
|
+
"neeto-editor",
|
147
|
+
"neeto-webhooks-frontend",
|
148
|
+
"neeto-slack-frontend",
|
149
|
+
"neeto-molecules",
|
150
|
+
"neeto-payments-frontend"
|
151
|
+
],
|
152
|
+
"nanos_backend": {
|
153
|
+
"neeto-team-members-engine": {
|
154
|
+
"semaphore": true
|
155
|
+
},
|
156
|
+
"neeto-integrations-engine": {
|
157
|
+
"semaphore": true
|
158
|
+
},
|
159
|
+
"neeto-ip-restrictions-engine": {
|
160
|
+
"semaphore": true
|
161
|
+
},
|
162
|
+
"neeto-github-engine": {
|
163
|
+
"semaphore": true
|
164
|
+
},
|
165
|
+
"neeto-form-engine": {
|
166
|
+
"semaphore": true
|
167
|
+
},
|
168
|
+
"neeto-approvals-engine": {
|
169
|
+
"semaphore": true
|
170
|
+
},
|
171
|
+
"neeto-filters-engine": {
|
172
|
+
"semaphore": true
|
173
|
+
},
|
174
|
+
"neeto-invite-links-engine": {
|
175
|
+
"semaphore": true
|
176
|
+
},
|
177
|
+
"neeto-slack-engine": {
|
178
|
+
"semaphore": true
|
179
|
+
},
|
180
|
+
"neeto-rules-engine": {
|
181
|
+
"semaphore": true
|
182
|
+
},
|
183
|
+
"neeto-custom-domains-engine": {
|
184
|
+
"semaphore": true
|
185
|
+
},
|
186
|
+
"neeto-payments-engine": {
|
187
|
+
"semaphore": true
|
188
|
+
},
|
189
|
+
"neeto-notifications-engine": {
|
190
|
+
"semaphore": true
|
191
|
+
},
|
192
|
+
"neeto-area51-engine": {
|
193
|
+
"semaphore": true
|
194
|
+
},
|
195
|
+
"neeto-tags-engine": {
|
196
|
+
"semaphore": true
|
197
|
+
},
|
198
|
+
"neeto-emails": {
|
199
|
+
"semaphore": false
|
200
|
+
},
|
201
|
+
"neeto-compliance": {
|
202
|
+
"semaphore": true
|
203
|
+
},
|
204
|
+
"neeto-monitor-ruby": {
|
205
|
+
"semaphore": true
|
206
|
+
},
|
207
|
+
"neeto-bugtrap-ruby": {
|
208
|
+
"semaphore": true
|
209
|
+
},
|
210
|
+
"neeto-sso": {
|
211
|
+
"semaphore": true
|
212
|
+
},
|
213
|
+
"neeto-commons-backend": {
|
214
|
+
"semaphore": true
|
215
|
+
},
|
216
|
+
"neeto-mail-interceptor": {
|
217
|
+
"semaphore": true
|
218
|
+
},
|
219
|
+
"neeto-email-prefixer": {
|
220
|
+
"semaphore": false
|
221
|
+
},
|
222
|
+
"neeto-webhooks-engine": {
|
223
|
+
"semaphore": true
|
224
|
+
},
|
225
|
+
"neeto-org-incineration-engine": {
|
226
|
+
"semaphore": false
|
227
|
+
},
|
228
|
+
"neeto-fields-engine": {
|
229
|
+
"semaphore": true
|
230
|
+
}
|
231
|
+
},
|
232
|
+
"nanos_mono_repos": [
|
233
|
+
"neeto-wheel-nano",
|
234
|
+
"neeto-message-templates"
|
235
|
+
],
|
236
|
+
"widgets": [
|
237
|
+
"neeto-changelog-widget",
|
238
|
+
"neeto-base-widget",
|
239
|
+
"neeto-chat-widget",
|
240
|
+
"neeto-replay-widget"
|
241
|
+
],
|
242
|
+
"chrome_extensions": ["neeto-invisible-chrome-extension"],
|
243
|
+
"electron_apps": ["neeto-planner-electron"],
|
244
|
+
"executables": [
|
245
|
+
"neetob",
|
246
|
+
"neeto-zero-to-one",
|
247
|
+
"gitemit",
|
248
|
+
"neeto-social-pdf-generator"
|
249
|
+
],
|
250
|
+
"helper_packages": [
|
251
|
+
"neeto-site-blocks",
|
252
|
+
"neeto-site-eui",
|
253
|
+
"neeto-code-blocks",
|
254
|
+
"neeto-course-page",
|
255
|
+
"neeto-course-site",
|
256
|
+
"neeto-course-nextjs",
|
257
|
+
"neeto-course-sql-runner",
|
258
|
+
"neeto-replay-lambda",
|
259
|
+
"neeto-compliance-automata",
|
260
|
+
"neeto-libraries-latest-version",
|
261
|
+
"neeto-deploy-package-json-standardizer-buildpack",
|
262
|
+
"neeto-deploy-awscli-buildpack",
|
263
|
+
"neeto-deploy-dyno-manager",
|
264
|
+
"neeto-deploy-pod-idling-service",
|
265
|
+
"neeto-deploy-downtime-service",
|
266
|
+
"neeto-deploy-addon-manager-web",
|
267
|
+
"neeto-deploy-slug-compiler-web",
|
268
|
+
"neeto-deploy-helm-chart",
|
269
|
+
"neeto-docker-images",
|
270
|
+
"neeto-code-docker-images"
|
271
|
+
],
|
272
|
+
"mobile_apps": [
|
273
|
+
"neeto-chat-rn",
|
274
|
+
"neeto-invoice-rn",
|
275
|
+
"neeto-desk-rn",
|
276
|
+
"neeto-planner-rn",
|
277
|
+
"neeto-form-rn",
|
278
|
+
"neeto-cal-rn",
|
279
|
+
"neeto-quiz-rn",
|
280
|
+
"wheel-rn",
|
281
|
+
"neeto-ui-rn",
|
282
|
+
"neeto-commons-rn",
|
283
|
+
"neeto-engineering-rn"
|
284
|
+
],
|
285
|
+
"other_repos": [
|
286
|
+
"neeto-code-web",
|
287
|
+
"neeto-website",
|
288
|
+
"neeto-blog",
|
289
|
+
"neeto-notifications-web",
|
290
|
+
"neeto-ip-lookup-web",
|
291
|
+
"neeto-engineering-web",
|
292
|
+
"neeto-engineering-ui-ux",
|
293
|
+
"neeto-slack-notification-web"
|
294
|
+
]
|
295
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "colorize"
|
4
|
+
|
5
|
+
require_relative "neeto_compliance/version"
|
6
|
+
require_relative "neeto_compliance/github_access"
|
7
|
+
require_relative "neeto_compliance/neeto_commons"
|
8
|
+
require_relative "neeto_compliance/verifiers_list"
|
9
|
+
require_relative "neeto_compliance/runner"
|
10
|
+
require_relative "neeto_compliance/verifiers/base"
|
11
|
+
require_relative "neeto_compliance/neeto_repos"
|
12
|
+
|
13
|
+
module NeetoCompliance
|
14
|
+
autoload :Skippable, "neeto_compliance/skippable"
|
15
|
+
|
16
|
+
Dir[File.dirname(__FILE__) + "/neeto_compliance/verifiers/*.rb"].each do |file|
|
17
|
+
require file
|
18
|
+
end
|
19
|
+
|
20
|
+
class Error < StandardError; end
|
21
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "base64"
|
4
|
+
|
5
|
+
module NeetoCompliance
|
6
|
+
class GithubAccess
|
7
|
+
def self.token
|
8
|
+
Base64.decode64(
|
9
|
+
File.read("Gemfile.common.rb")
|
10
|
+
.split("encoded_github_auth_string =")[1]
|
11
|
+
.split("%{")[1]
|
12
|
+
.split("}")[0]
|
13
|
+
.gsub("\\r", "\r")
|
14
|
+
.gsub("\\n", "\n")
|
15
|
+
).split(":")[1]
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.latest_commit_sha(uri)
|
19
|
+
JSON.parse(get(uri))["sha"]
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.get(uri)
|
23
|
+
response = Net::HTTP.get_response(
|
24
|
+
URI(uri), {
|
25
|
+
"Authorization" => "Bearer #{token}"
|
26
|
+
}).body
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "base64"
|
4
|
+
|
5
|
+
module NeetoCompliance
|
6
|
+
class NeetoCommons
|
7
|
+
def self.path
|
8
|
+
@@_neeto_commons_path ||= get_path
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.get_path
|
12
|
+
path = `bundle info neeto-commons-backend`.split(" ").last
|
13
|
+
Pathname.new(path).join("lib", "neeto_commons_backend")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NeetoCompliance
|
4
|
+
class NeetoRepos
|
5
|
+
def self.products
|
6
|
+
repos["products"]
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.nanos_backend
|
10
|
+
repos["nanos_backend"].keys
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.nanos_frontend
|
14
|
+
repos["nanos_frontend"]
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.nanos
|
18
|
+
repos["nanos_backend"].keys + repos["nanos_frontend"]
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.widgets
|
22
|
+
repos["widgets"]
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.chrome_extensions
|
26
|
+
repos["chrome_extensions"]
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.helper_packages
|
30
|
+
repos["helper_packages"]
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.electron_apps
|
34
|
+
repos["electron_apps"]
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.executables
|
38
|
+
repos["executables"]
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.mobile_apps
|
42
|
+
repos["mobile_apps"]
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.other_repos
|
46
|
+
repos["other_repos"]
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.nanos_mono_repos
|
50
|
+
repos["nanos_mono_repos"]
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.repos
|
54
|
+
file_path = File.expand_path("../../data/neeto_repos.json", __dir__)
|
55
|
+
file = File.read(file_path)
|
56
|
+
@_repos ||= JSON.parse(file)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NeetoCompliance
|
4
|
+
class Runner
|
5
|
+
def verifiers
|
6
|
+
if app_name == "neeto-auth-web"
|
7
|
+
VerifiersList.neeto_auth
|
8
|
+
elsif NeetoCompliance::NeetoRepos.nanos_backend.include?(app_name)
|
9
|
+
VerifiersList.neeto_gems
|
10
|
+
elsif NeetoCompliance::NeetoRepos.nanos_mono_repos.include?(app_name)
|
11
|
+
VerifiersList.neeto_gems
|
12
|
+
else
|
13
|
+
VerifiersList.neeto_apps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def process
|
18
|
+
results = verifiers.map do |verifier|
|
19
|
+
verifier.new.process
|
20
|
+
end
|
21
|
+
|
22
|
+
results.all? ? exit(0) : exit(1)
|
23
|
+
end
|
24
|
+
|
25
|
+
def auto_correct
|
26
|
+
puts "Running auto_correct ...".yellow
|
27
|
+
results = verifiers.map do |verifier|
|
28
|
+
verifier.new.auto_correct!
|
29
|
+
end
|
30
|
+
|
31
|
+
puts %(
|
32
|
+
Auto fixing got completed \n
|
33
|
+
Please run bundle exec neeto-audit once again to fix other errors manually if any \n
|
34
|
+
).yellow
|
35
|
+
|
36
|
+
results.all? ? exit(0) : exit(1)
|
37
|
+
end
|
38
|
+
|
39
|
+
def app_name
|
40
|
+
@_app_name ||= `git config --get remote.origin.url`.split("/").last.strip.split(".git").first
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Skippable
|
4
|
+
def self.included(base)
|
5
|
+
base.class_eval do
|
6
|
+
include InstanceMethods
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module InstanceMethods
|
11
|
+
def skip?
|
12
|
+
`git config --get remote.origin.url`.split("/").last.strip.include? "neeto-auth-web"
|
13
|
+
end
|
14
|
+
|
15
|
+
def app_is?(git_repo)
|
16
|
+
`git config --get remote.origin.url`.split("/").last.strip.include? "#{git_repo}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "neeto_compliance/github_access"
|
4
|
+
require "neeto_compliance/sync_neeto_commons"
|
5
|
+
|
6
|
+
module NeetoCompliance
|
7
|
+
class SyncNeetoCommons
|
8
|
+
class SyncBin
|
9
|
+
def self.BIN_FILES
|
10
|
+
[
|
11
|
+
"bin/bundle",
|
12
|
+
"bin/setup",
|
13
|
+
"bin/update",
|
14
|
+
"bin/webpacker",
|
15
|
+
"bin/webpacker-dev-server",
|
16
|
+
"bin/yarn"
|
17
|
+
]
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.process
|
21
|
+
sync_bin_files
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.sync_bin_files
|
25
|
+
self.BIN_FILES.each do |file|
|
26
|
+
print "Downloading #{file}...\n"
|
27
|
+
system(`cp #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} #{file}`)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "neeto_compliance/github_access"
|
4
|
+
require "neeto_compliance/sync_neeto_commons"
|
5
|
+
|
6
|
+
module NeetoCompliance
|
7
|
+
class SyncNeetoCommons
|
8
|
+
class SyncFormatters
|
9
|
+
def self.CONFIG_FILES
|
10
|
+
[
|
11
|
+
".eslintrc.js",
|
12
|
+
".eslintignore",
|
13
|
+
".rubocop.yml",
|
14
|
+
".prettierrc.js",
|
15
|
+
"cypress-tests/.eslintrc.js",
|
16
|
+
".erb-lint.yml",
|
17
|
+
]
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.process
|
21
|
+
self.CONFIG_FILES.each do |file|
|
22
|
+
print "Copying #{file}...\n"
|
23
|
+
system(`cp #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} #{file}`)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "neeto_compliance/github_access"
|
4
|
+
require "neeto_compliance/sync_neeto_commons"
|
5
|
+
|
6
|
+
module NeetoCompliance
|
7
|
+
class SyncNeetoCommons
|
8
|
+
class SyncHusky
|
9
|
+
def self.HUSKY_FILES
|
10
|
+
[
|
11
|
+
".husky/pre-push",
|
12
|
+
".husky/pre-commit",
|
13
|
+
".husky/helpers/lint_staged.sh",
|
14
|
+
".husky/helpers/prevent_conflict_markers.sh",
|
15
|
+
".husky/helpers/prevent_pushing_to_main.sh",
|
16
|
+
".husky/helpers/verify_neeto_audit.sh"
|
17
|
+
]
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.process
|
21
|
+
sync_with_husky_files_in_neeto_commons
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.sync_with_husky_files_in_neeto_commons
|
25
|
+
self.HUSKY_FILES.each do |file|
|
26
|
+
print "Downloading #{file}...\n"
|
27
|
+
system(`cp #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} #{file}`)
|
28
|
+
system("chmod +x #{file}")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "neeto_compliance/github_access"
|
4
|
+
require "neeto_compliance/sync_neeto_commons"
|
5
|
+
|
6
|
+
module NeetoCompliance
|
7
|
+
class SyncNeetoCommons
|
8
|
+
class SyncMisc
|
9
|
+
def self.MISC_FILES
|
10
|
+
[
|
11
|
+
".editorconfig",
|
12
|
+
".vscode/extensions.json",
|
13
|
+
".vscode/settings.json",
|
14
|
+
".semaphore/commands/run_eslint_on_modified_files.sh",
|
15
|
+
".node-version",
|
16
|
+
".nvmrc",
|
17
|
+
".ruby-version",
|
18
|
+
".postcssrc.yml",
|
19
|
+
"babel.config.js",
|
20
|
+
"app/javascript/src/types.d.ts"
|
21
|
+
]
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.process
|
25
|
+
sync_misc_files
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.sync_misc_files
|
29
|
+
self.MISC_FILES.each do |file|
|
30
|
+
print "Downloading #{file}...\n"
|
31
|
+
system(`cp #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} #{file}`)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "neeto_compliance/github_access"
|
4
|
+
require "neeto_compliance/sync_neeto_commons"
|
5
|
+
require "fileutils"
|
6
|
+
|
7
|
+
module NeetoCompliance
|
8
|
+
class SyncNeetoCommons
|
9
|
+
class SyncTestSupport
|
10
|
+
SUPPORT_DIR = "test/support"
|
11
|
+
|
12
|
+
def self.SUPPORT_FILES
|
13
|
+
[
|
14
|
+
"test/support/assertion_support.rb"
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.process
|
19
|
+
ensure_test_support_folder_exists
|
20
|
+
sync_support_files
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.ensure_test_support_folder_exists
|
24
|
+
unless File.directory?(SUPPORT_DIR)
|
25
|
+
puts "Creating test support directory..."
|
26
|
+
FileUtils.mkdir_p SUPPORT_DIR
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.sync_support_files
|
31
|
+
self.SUPPORT_FILES.each do |file|
|
32
|
+
print "Copying #{file}...\n"
|
33
|
+
system(`cp #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} #{file}`)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "neeto_compliance/sync_neeto_commons/sync_bin"
|
4
|
+
require "neeto_compliance/sync_neeto_commons/sync_formatters"
|
5
|
+
require "neeto_compliance/sync_neeto_commons/sync_husky"
|
6
|
+
require "neeto_compliance/sync_neeto_commons/sync_misc"
|
7
|
+
require "neeto_compliance/sync_neeto_commons/sync_test_support"
|
8
|
+
require "neeto_compliance/neeto_commons"
|
9
|
+
|
10
|
+
module NeetoCompliance
|
11
|
+
class SyncNeetoCommons
|
12
|
+
def self.neeto_commons_url
|
13
|
+
NeetoCompliance::NeetoCommons.path.join "common_files/"
|
14
|
+
end
|
15
|
+
|
16
|
+
def process
|
17
|
+
sync_with_neeto_commons
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def sync_with_neeto_commons
|
23
|
+
syncers = [
|
24
|
+
SyncBin,
|
25
|
+
SyncFormatters,
|
26
|
+
SyncHusky,
|
27
|
+
SyncMisc,
|
28
|
+
SyncTestSupport
|
29
|
+
]
|
30
|
+
|
31
|
+
syncers.each do |syncer|
|
32
|
+
syncer.process
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|