neeto-compliance 1.0.58

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +10 -0
  3. data/.husky/helpers/verify_neeto_audit.sh +18 -0
  4. data/.husky/pre-push +7 -0
  5. data/.neetoci/neetoci.yml +18 -0
  6. data/.overcommit.yml +47 -0
  7. data/.rubocop.yml +596 -0
  8. data/.ruby-version +1 -0
  9. data/.semaphore/semaphore.yml +33 -0
  10. data/CHANGELOG.md +375 -0
  11. data/Gemfile +36 -0
  12. data/Gemfile.lock +435 -0
  13. data/README.md +85 -0
  14. data/Rakefile +12 -0
  15. data/bin/console +15 -0
  16. data/bin/neeto-audit +11 -0
  17. data/bin/neeto_repos_verifier/client_config.json +7 -0
  18. data/bin/neeto_repos_verifier/list_verifier.rb +93 -0
  19. data/bin/setup +8 -0
  20. data/bin/sync-neeto-repos +5 -0
  21. data/bin/sync-with-neeto-commons +5 -0
  22. data/config/brakeman.ignore +604 -0
  23. data/data/neeto_repos.json +295 -0
  24. data/lib/neeto-compliance.rb +21 -0
  25. data/lib/neeto_compliance/github_access.rb +29 -0
  26. data/lib/neeto_compliance/neeto_commons.rb +16 -0
  27. data/lib/neeto_compliance/neeto_repos.rb +59 -0
  28. data/lib/neeto_compliance/runner.rb +43 -0
  29. data/lib/neeto_compliance/skippable.rb +19 -0
  30. data/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +32 -0
  31. data/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +28 -0
  32. data/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +33 -0
  33. data/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +36 -0
  34. data/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +38 -0
  35. data/lib/neeto_compliance/sync_neeto_commons.rb +36 -0
  36. data/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +25 -0
  37. data/lib/neeto_compliance/verifiers/base.rb +77 -0
  38. data/lib/neeto_compliance/verifiers/bump_version_with_pr_label_verifier.rb +25 -0
  39. data/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +48 -0
  40. data/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +25 -0
  41. data/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +25 -0
  42. data/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +25 -0
  43. data/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +46 -0
  44. data/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +25 -0
  45. data/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +25 -0
  46. data/lib/neeto_compliance/verifiers/environment_config_verifier.rb +38 -0
  47. data/lib/neeto_compliance/verifiers/gem_version_verifier.rb +33 -0
  48. data/lib/neeto_compliance/verifiers/gems_verifier_base.rb +44 -0
  49. data/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +37 -0
  50. data/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +187 -0
  51. data/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +42 -0
  52. data/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +36 -0
  53. data/lib/neeto_compliance/verifiers/newrelic_verifier.rb +25 -0
  54. data/lib/neeto_compliance/verifiers/node_version_verifier.rb +84 -0
  55. data/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +59 -0
  56. data/lib/neeto_compliance/verifiers/package_json_verifier.rb +46 -0
  57. data/lib/neeto_compliance/verifiers/roles_verifier.rb +22 -0
  58. data/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +25 -0
  59. data/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +74 -0
  60. data/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +36 -0
  61. data/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +29 -0
  62. data/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +29 -0
  63. data/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +25 -0
  64. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +29 -0
  65. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +29 -0
  66. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +29 -0
  67. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +29 -0
  68. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +28 -0
  69. data/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +31 -0
  70. data/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +32 -0
  71. data/lib/neeto_compliance/verifiers_list.rb +55 -0
  72. data/lib/neeto_compliance/version.rb +5 -0
  73. data/neeto-compliance.gemspec +35 -0
  74. data/package.json +9 -0
  75. data/yarn.lock +8 -0
  76. metadata +177 -0
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "neeto_compliance/sync_neeto_commons"
4
+ require "neeto_compliance/sync_neeto_commons/sync_test_support"
5
+
6
+ module NeetoCompliance
7
+ class SyncNeetoCommonsVerifier < Base
8
+ class TestSupportFilesVerifier
9
+ def process
10
+ return false unless support_folder_exist?
11
+
12
+ non_complied_test_support_files.empty?
13
+ end
14
+
15
+ private
16
+
17
+ def support_folder_exist?
18
+ File.directory?(NeetoCompliance::SyncNeetoCommons::SyncTestSupport::SUPPORT_DIR)
19
+ end
20
+
21
+ def non_complied_test_support_files
22
+ NeetoCompliance::SyncNeetoCommons::SyncTestSupport.SUPPORT_FILES.select do |file|
23
+ !system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier"
4
+ require "neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier"
5
+ require "neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier"
6
+ require "neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier"
7
+ require "neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier"
8
+
9
+ module NeetoCompliance
10
+ class SyncNeetoCommonsVerifier < Base
11
+ def valid?
12
+ verifiers = [
13
+ BinFilesVerifier,
14
+ FormatterFilesVerifier,
15
+ HuskyFilesVerifier,
16
+ MiscFilesVerifier,
17
+ TestSupportFilesVerifier
18
+ ]
19
+
20
+ results = verifiers.map do |verifier|
21
+ verifier.new.process
22
+ end
23
+
24
+ success = results.all?
25
+ end
26
+
27
+ def autofix_command
28
+ "bundle exec sync-with-neeto-commons"
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NeetoCompliance
4
+ class WebpackerConfigVerifier < Base
5
+ def local_copy
6
+ "config/webpacker.yml"
7
+ end
8
+
9
+ def commons_copy
10
+ NeetoCompliance::NeetoCommons.path.join "common_files/webpacker.yml"
11
+ end
12
+
13
+ def compare_files
14
+ @file_difference = `diff #{commons_copy} #{local_copy} | grep '<'`
15
+ end
16
+
17
+ def valid?
18
+ compare_files
19
+ @file_difference.empty?
20
+ end
21
+
22
+ def autofix_suggestion
23
+ warning = "Following configuration lines are missing in webpacker config (config/webpacker.yml). Please refer #{commons_copy}"
24
+ .yellow
25
+ missing_lines = @file_difference.delete("<").red
26
+ "#{warning}\n\n#{missing_lines}"
27
+ end
28
+
29
+ def auto_correct!
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NeetoCompliance
4
+ class VerifiersList
5
+ class << self
6
+ def neeto_auth
7
+ [NeetoGemsVerifier].concat(neeto_products_common_verifiers)
8
+ end
9
+
10
+ def neeto_apps
11
+ [ NeetoGemsVerifier,
12
+ CommonGemfileVerifier,
13
+ SemaphoreciConfigVerifier,
14
+ EnvironmentConfigVerifier,
15
+ RolesVerifier,
16
+ JsconfigVerifier
17
+ ].concat(neeto_products_common_verifiers)
18
+ end
19
+
20
+ def neeto_gems
21
+ [ NeetoGemsVerifier,
22
+ RubyVersionVerifier,
23
+ # BumpVersionWithPrLabelVerifier, # Disabling for sometime to test google's release please action
24
+ AutoUpdatePrsWithLatestMasterVerifier
25
+ ]
26
+ end
27
+
28
+ private
29
+
30
+ def neeto_products_common_verifiers
31
+ [
32
+ CircleciConfigVerifier,
33
+ SitemapConfigVerifier,
34
+ CommonInitializersVerifier,
35
+ NewrelicVerifier,
36
+ RubyVersionVerifier,
37
+ DockerFileDevVerifier,
38
+ NodeVersionVerifier,
39
+ SlugignoreFileVerifier,
40
+ GitignoreFileVerifier,
41
+ SidekiqQueuesVerifier,
42
+ SimplecovConfigVerifier,
43
+ PackageDependenciesVersionVerifier,
44
+ PackageJsonVerifier,
45
+ CypressConfigVerifier,
46
+ BundlerVersionVerifier,
47
+ SyncNeetoCommonsVerifier,
48
+ CypressPluginsIndexVerifier,
49
+ WebpackerConfigVerifier,
50
+ AutoUpdatePrsWithLatestMasterVerifier
51
+ ]
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NeetoCompliance
4
+ VERSION = "1.0.58"
5
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/neeto_compliance/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'neeto-compliance'
7
+ spec.version = NeetoCompliance::VERSION
8
+ spec.authors = ['Unnikrishnan KP']
9
+ spec.email = ['unnikrishnan.kp@bigbinary.com']
10
+
11
+ spec.summary = 'Check if the project follows guidelines setup for Neeto Products'
12
+ spec.homepage = 'https://github.com/bigbinary/neeto-compliance'
13
+ spec.required_ruby_version = '>= 2.4.0'
14
+
15
+ spec.metadata['homepage_uri'] = spec.homepage
16
+ spec.metadata['source_code_uri'] = 'https://github.com/bigbinary/neeto-compliance'
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
+ `git ls-files -z`.split("\x0").reject do |f|
22
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
23
+ end
24
+ end
25
+ spec.bindir = 'bin'
26
+ spec.executables = %w[neeto-audit sync-with-neeto-commons sync-neeto-repos]
27
+ spec.require_paths = ['lib']
28
+
29
+ spec.add_dependency "colorize"
30
+ spec.add_dependency "json", "~> 2.6.2" # for json manipulation
31
+ spec.add_dependency "hashdiff" # for comparing deeply nested hashes
32
+ spec.add_dependency "deep_merge"
33
+ # For more information and examples about making a new gem, checkout our
34
+ # guide at: https://bundler.io/guides/creating_gem.html
35
+ end
data/package.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "neeto-compliance",
3
+ "devDependencies": {
4
+ "husky": "^7.0.0"
5
+ },
6
+ "scripts": {
7
+ "prepare": "husky install"
8
+ }
9
+ }
data/yarn.lock ADDED
@@ -0,0 +1,8 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ husky@^7.0.0:
6
+ version "7.0.4"
7
+ resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
8
+ integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
metadata ADDED
@@ -0,0 +1,177 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: neeto-compliance
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.58
5
+ platform: ruby
6
+ authors:
7
+ - Unnikrishnan KP
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-05-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colorize
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.6.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.6.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: hashdiff
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: deep_merge
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description:
70
+ email:
71
+ - unnikrishnan.kp@bigbinary.com
72
+ executables:
73
+ - neeto-audit
74
+ - sync-with-neeto-commons
75
+ - sync-neeto-repos
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".editorconfig"
80
+ - ".husky/helpers/verify_neeto_audit.sh"
81
+ - ".husky/pre-push"
82
+ - ".neetoci/neetoci.yml"
83
+ - ".overcommit.yml"
84
+ - ".rubocop.yml"
85
+ - ".ruby-version"
86
+ - ".semaphore/semaphore.yml"
87
+ - CHANGELOG.md
88
+ - Gemfile
89
+ - Gemfile.lock
90
+ - README.md
91
+ - Rakefile
92
+ - bin/console
93
+ - bin/neeto-audit
94
+ - bin/neeto_repos_verifier/client_config.json
95
+ - bin/neeto_repos_verifier/list_verifier.rb
96
+ - bin/setup
97
+ - bin/sync-neeto-repos
98
+ - bin/sync-with-neeto-commons
99
+ - config/brakeman.ignore
100
+ - data/neeto_repos.json
101
+ - lib/neeto-compliance.rb
102
+ - lib/neeto_compliance/github_access.rb
103
+ - lib/neeto_compliance/neeto_commons.rb
104
+ - lib/neeto_compliance/neeto_repos.rb
105
+ - lib/neeto_compliance/runner.rb
106
+ - lib/neeto_compliance/skippable.rb
107
+ - lib/neeto_compliance/sync_neeto_commons.rb
108
+ - lib/neeto_compliance/sync_neeto_commons/sync_bin.rb
109
+ - lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb
110
+ - lib/neeto_compliance/sync_neeto_commons/sync_husky.rb
111
+ - lib/neeto_compliance/sync_neeto_commons/sync_misc.rb
112
+ - lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb
113
+ - lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb
114
+ - lib/neeto_compliance/verifiers/base.rb
115
+ - lib/neeto_compliance/verifiers/bump_version_with_pr_label_verifier.rb
116
+ - lib/neeto_compliance/verifiers/bundler_version_verifier.rb
117
+ - lib/neeto_compliance/verifiers/circleci_config_verifier.rb
118
+ - lib/neeto_compliance/verifiers/common_gemfile_verifier.rb
119
+ - lib/neeto_compliance/verifiers/common_initializers_verifier.rb
120
+ - lib/neeto_compliance/verifiers/cypress_config_verifier.rb
121
+ - lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb
122
+ - lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb
123
+ - lib/neeto_compliance/verifiers/environment_config_verifier.rb
124
+ - lib/neeto_compliance/verifiers/gem_version_verifier.rb
125
+ - lib/neeto_compliance/verifiers/gems_verifier_base.rb
126
+ - lib/neeto_compliance/verifiers/gitignore_file_verifier.rb
127
+ - lib/neeto_compliance/verifiers/jsconfig_verifier.rb
128
+ - lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb
129
+ - lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb
130
+ - lib/neeto_compliance/verifiers/newrelic_verifier.rb
131
+ - lib/neeto_compliance/verifiers/node_version_verifier.rb
132
+ - lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb
133
+ - lib/neeto_compliance/verifiers/package_json_verifier.rb
134
+ - lib/neeto_compliance/verifiers/roles_verifier.rb
135
+ - lib/neeto_compliance/verifiers/ruby_version_verifier.rb
136
+ - lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb
137
+ - lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb
138
+ - lib/neeto_compliance/verifiers/simplecov_config_verifier.rb
139
+ - lib/neeto_compliance/verifiers/sitemap_config_verifier.rb
140
+ - lib/neeto_compliance/verifiers/slugignore_file_verifier.rb
141
+ - lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb
142
+ - lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb
143
+ - lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb
144
+ - lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb
145
+ - lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb
146
+ - lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb
147
+ - lib/neeto_compliance/verifiers/webpacker_config_verifier.rb
148
+ - lib/neeto_compliance/verifiers_list.rb
149
+ - lib/neeto_compliance/version.rb
150
+ - neeto-compliance.gemspec
151
+ - package.json
152
+ - yarn.lock
153
+ homepage: https://github.com/bigbinary/neeto-compliance
154
+ licenses: []
155
+ metadata:
156
+ homepage_uri: https://github.com/bigbinary/neeto-compliance
157
+ source_code_uri: https://github.com/bigbinary/neeto-compliance
158
+ post_install_message:
159
+ rdoc_options: []
160
+ require_paths:
161
+ - lib
162
+ required_ruby_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 2.4.0
167
+ required_rubygems_version: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ requirements: []
173
+ rubygems_version: 3.2.33
174
+ signing_key:
175
+ specification_version: 4
176
+ summary: Check if the project follows guidelines setup for Neeto Products
177
+ test_files: []