neetob 0.1.2 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/.ruby-version +1 -1
  4. data/.semaphore/semaphore.yml +4 -5
  5. data/CHANGELOG.md +21 -0
  6. data/Gemfile +10 -0
  7. data/Gemfile.lock +15 -1
  8. data/README.md +197 -118
  9. data/bookmarks.md +30 -0
  10. data/data/branch-protection-rules.json +1 -1
  11. data/data/github-labels.json +54 -29
  12. data/images/commit-message-update.png +0 -0
  13. data/lib/neetob/cli/base.rb +22 -10
  14. data/lib/neetob/cli/fetchorupdate_repos/execute.rb +5 -3
  15. data/lib/neetob/cli/github/auth.rb +3 -3
  16. data/lib/neetob/cli/github/base.rb +7 -0
  17. data/lib/neetob/cli/github/commands.rb +6 -2
  18. data/lib/neetob/cli/github/labels/commands.rb +18 -10
  19. data/lib/neetob/cli/github/labels/delete.rb +5 -3
  20. data/lib/neetob/cli/github/labels/delete_all.rb +5 -3
  21. data/lib/neetob/cli/github/labels/list.rb +5 -3
  22. data/lib/neetob/cli/github/labels/show.rb +5 -3
  23. data/lib/neetob/cli/github/labels/update.rb +16 -4
  24. data/lib/neetob/cli/github/labels/upsert.rb +43 -7
  25. data/lib/neetob/cli/github/make_pr/base.rb +2 -1
  26. data/lib/neetob/cli/github/make_pr/commands.rb +4 -1
  27. data/lib/neetob/cli/github/make_pr/compliance_fix.rb +6 -1
  28. data/lib/neetob/cli/github/make_pr/script.rb +4 -3
  29. data/lib/neetob/cli/github/protect_branch.rb +5 -3
  30. data/lib/neetob/cli/heroku/config_vars/upsert.rb +6 -2
  31. data/lib/neetob/cli/heroku/execute.rb +2 -2
  32. data/lib/neetob/cli/ui.rb +1 -1
  33. data/lib/neetob/cli/users/commands.rb +3 -1
  34. data/lib/neetob/cli/users/commits.rb +71 -22
  35. data/lib/neetob/cli.rb +3 -1
  36. data/lib/neetob/exception_handler.rb +3 -1
  37. data/lib/neetob/version.rb +1 -1
  38. data/neetob.gemspec +1 -1
  39. metadata +8 -57
  40. data/LICENSE.txt +0 -21
  41. data/env.sample +0 -1
  42. data/neeto_compliance/lib/neeto_compliance/github_access.rb +0 -29
  43. data/neeto_compliance/lib/neeto_compliance/neeto_apps.rb +0 -35
  44. data/neeto_compliance/lib/neeto_compliance/neeto_commons.rb +0 -16
  45. data/neeto_compliance/lib/neeto_compliance/runner.rb +0 -35
  46. data/neeto_compliance/lib/neeto_compliance/skippable.rb +0 -19
  47. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_bin.rb +0 -32
  48. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_formatters.rb +0 -35
  49. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_husky.rb +0 -33
  50. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_misc.rb +0 -36
  51. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons/sync_test_support.rb +0 -38
  52. data/neeto_compliance/lib/neeto_compliance/sync_neeto_commons.rb +0 -36
  53. data/neeto_compliance/lib/neeto_compliance/verifiers/auto_update_prs_with_latest_master_verifier.rb +0 -25
  54. data/neeto_compliance/lib/neeto_compliance/verifiers/base.rb +0 -72
  55. data/neeto_compliance/lib/neeto_compliance/verifiers/bundler_version_verifier.rb +0 -53
  56. data/neeto_compliance/lib/neeto_compliance/verifiers/circleci_config_verifier.rb +0 -25
  57. data/neeto_compliance/lib/neeto_compliance/verifiers/common_gemfile_verifier.rb +0 -25
  58. data/neeto_compliance/lib/neeto_compliance/verifiers/common_initializers_verifier.rb +0 -25
  59. data/neeto_compliance/lib/neeto_compliance/verifiers/cypress_config_verifier.rb +0 -46
  60. data/neeto_compliance/lib/neeto_compliance/verifiers/cypress_plugins_index_verifier.rb +0 -25
  61. data/neeto_compliance/lib/neeto_compliance/verifiers/docker_file_dev_verifier.rb +0 -25
  62. data/neeto_compliance/lib/neeto_compliance/verifiers/environment_config_verifier.rb +0 -38
  63. data/neeto_compliance/lib/neeto_compliance/verifiers/gem_version_verifier.rb +0 -38
  64. data/neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb +0 -34
  65. data/neeto_compliance/lib/neeto_compliance/verifiers/gitignore_file_verifier.rb +0 -39
  66. data/neeto_compliance/lib/neeto_compliance/verifiers/jsconfig_verifier.rb +0 -100
  67. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_auth_gems_verifier.rb +0 -20
  68. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_commons_sync_verifier.rb +0 -42
  69. data/neeto_compliance/lib/neeto_compliance/verifiers/neeto_gems_version_verifier.rb +0 -24
  70. data/neeto_compliance/lib/neeto_compliance/verifiers/newrelic_verifier.rb +0 -25
  71. data/neeto_compliance/lib/neeto_compliance/verifiers/node_version_verifier.rb +0 -63
  72. data/neeto_compliance/lib/neeto_compliance/verifiers/package_dependencies_version_verifier.rb +0 -62
  73. data/neeto_compliance/lib/neeto_compliance/verifiers/package_json_verifier.rb +0 -39
  74. data/neeto_compliance/lib/neeto_compliance/verifiers/roles_verifier.rb +0 -22
  75. data/neeto_compliance/lib/neeto_compliance/verifiers/ruby_version_verifier.rb +0 -25
  76. data/neeto_compliance/lib/neeto_compliance/verifiers/semaphoreci_config_verifier.rb +0 -162
  77. data/neeto_compliance/lib/neeto_compliance/verifiers/sidekiq_queues_verifier.rb +0 -34
  78. data/neeto_compliance/lib/neeto_compliance/verifiers/simplecov_config_verifier.rb +0 -28
  79. data/neeto_compliance/lib/neeto_compliance/verifiers/sitemap_config_verifier.rb +0 -29
  80. data/neeto_compliance/lib/neeto_compliance/verifiers/slugignore_file_verifier.rb +0 -25
  81. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/bin_files_verifier.rb +0 -29
  82. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/formatter_files_verifier.rb +0 -29
  83. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/husky_files_verifier.rb +0 -29
  84. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/misc_files_verifier.rb +0 -29
  85. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier/test_support_files_verifier.rb +0 -28
  86. data/neeto_compliance/lib/neeto_compliance/verifiers/sync_neeto_commons_verifier.rb +0 -31
  87. data/neeto_compliance/lib/neeto_compliance/verifiers/webpack_configuration_verifier.rb +0 -44
  88. data/neeto_compliance/lib/neeto_compliance/verifiers/webpacker_config_verifier.rb +0 -29
  89. data/neeto_compliance/lib/neeto_compliance/verifiers_list.rb +0 -61
  90. data/neeto_compliance/lib/neeto_compliance/version.rb +0 -5
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module NeetoCompliance
4
- class SlugignoreFileVerifier < Base
5
- def local_copy
6
- ".slugignore"
7
- end
8
-
9
- def commons_copy
10
- NeetoCompliance::NeetoCommons.path.join local_copy
11
- end
12
-
13
- def verify_command
14
- "diff -N #{commons_copy} #{local_copy}"
15
- end
16
-
17
- def valid?
18
- `#{verify_command}`.empty?
19
- end
20
-
21
- def autofix_command
22
- "cp #{commons_copy} #{local_copy}"
23
- end
24
- end
25
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "net/http"
4
- require "json"
5
- require "yaml"
6
-
7
- require "neeto_compliance/sync_neeto_commons"
8
-
9
- module NeetoCompliance
10
- class SyncNeetoCommonsVerifier < Base
11
- class BinFilesVerifier
12
- def process
13
- non_complied_bin_files = find_non_complied_bin_files
14
-
15
- return false if non_complied_bin_files.any?
16
-
17
- true
18
- end
19
-
20
- private
21
-
22
- def find_non_complied_bin_files
23
- NeetoCompliance::SyncNeetoCommons::SyncBin.BIN_FILES.select do |file|
24
- !system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "net/http"
4
- require "json"
5
- require "yaml"
6
-
7
- require "neeto_compliance/sync_neeto_commons"
8
-
9
- module NeetoCompliance
10
- class SyncNeetoCommonsVerifier < Base
11
- class FormatterFilesVerifier
12
- def process
13
- non_complied_formatter_files = find_non_complied_formatter_files
14
-
15
- return false if non_complied_formatter_files.any?
16
-
17
- true
18
- end
19
-
20
- private
21
-
22
- def find_non_complied_formatter_files
23
- NeetoCompliance::SyncNeetoCommons::SyncFormatters.CONFIG_FILES.select do |file|
24
- !system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "net/http"
4
- require "json"
5
- require "yaml"
6
-
7
- require "neeto_compliance/sync_neeto_commons"
8
-
9
- module NeetoCompliance
10
- class SyncNeetoCommonsVerifier < Base
11
- class HuskyFilesVerifier
12
- def process
13
- non_complied_husky_files = find_non_complied_husky_files
14
-
15
- return false if non_complied_husky_files.any?
16
-
17
- true
18
- end
19
-
20
- private
21
-
22
- def find_non_complied_husky_files
23
- NeetoCompliance::SyncNeetoCommons::SyncHusky.HUSKY_FILES.select do |file|
24
- !system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "net/http"
4
- require "json"
5
- require "yaml"
6
-
7
- require "neeto_compliance/sync_neeto_commons"
8
-
9
- module NeetoCompliance
10
- class SyncNeetoCommonsVerifier < Base
11
- class MiscFilesVerifier
12
- def process
13
- non_complied_misc_files = find_non_complied_misc_files
14
-
15
- return false if non_complied_misc_files.any?
16
-
17
- true
18
- end
19
-
20
- private
21
-
22
- def find_non_complied_misc_files
23
- NeetoCompliance::SyncNeetoCommons::SyncMisc.MISC_FILES.select do |file|
24
- !system("cat #{NeetoCompliance::SyncNeetoCommons.neeto_commons_url}#{file} | diff #{file} - 1> /dev/null")
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,28 +0,0 @@
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
@@ -1,31 +0,0 @@
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
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module NeetoCompliance
4
- class WebpackConfigurationVerifier < Base
5
- def files_to_sync
6
- @_files_to_sync ||= {
7
- "config/webpack/development.js" => NeetoCompliance::NeetoCommons.path.join("webpack/development.js"),
8
- "config/webpack/production.js" => NeetoCompliance::NeetoCommons.path.join("webpack/production.js"),
9
- "config/webpack/staging.js" => NeetoCompliance::NeetoCommons.path.join("webpack/staging.js"),
10
- "config/webpack/test.js" => NeetoCompliance::NeetoCommons.path.join("webpack/test.js")
11
- }
12
- end
13
-
14
- def auto_correct!
15
- unless valid?
16
- @autofix_commands.each do |command|
17
- puts command
18
- system(command)
19
- end
20
- end
21
- end
22
-
23
- def autofix_suggestion
24
- @autofix_commands.join("\n").yellow
25
- end
26
-
27
- def valid?
28
- @autofix_commands = []
29
-
30
- files_to_sync.each_pair do |local_file, common_file|
31
- unless same_file?(local_file, common_file)
32
- @autofix_commands << "cp #{common_file.to_s} #{local_file}"
33
- end
34
- end
35
-
36
- @autofix_commands.length == 0
37
- end
38
-
39
- def same_file?(local_file, common_file)
40
- File.exist?(local_file) &&
41
- `diff #{local_file} #{common_file.to_s}`.empty?
42
- end
43
- end
44
- end
@@ -1,29 +0,0 @@
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
- end
29
- end
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module NeetoCompliance
4
- class VerifiersList
5
- def self.neeto_auth
6
- [
7
- NeetoAuthGemsVerifier,
8
- CircleciConfigVerifier,
9
- SitemapConfigVerifier,
10
- # CommonInitializersVerifier,
11
- NewrelicVerifier,
12
- RubyVersionVerifier,
13
- DockerFileDevVerifier,
14
- NodeVersionVerifier,
15
- SlugignoreFileVerifier,
16
- GitignoreFileVerifier,
17
- WebpackConfigurationVerifier,
18
- SidekiqQueuesVerifier,
19
- SimplecovConfigVerifier,
20
- PackageDependenciesVersionVerifier,
21
- PackageJsonVerifier,
22
- CypressConfigVerifier,
23
- # BundlerVersionVerifier,
24
- SyncNeetoCommonsVerifier,
25
- CypressPluginsIndexVerifier,
26
- WebpackerConfigVerifier
27
- ]
28
- end
29
-
30
- def self.neeto_apps
31
- [
32
- NeetoGemsVerifier,
33
- CircleciConfigVerifier,
34
- SitemapConfigVerifier,
35
- CommonGemfileVerifier,
36
- CommonInitializersVerifier,
37
- NewrelicVerifier,
38
- RubyVersionVerifier,
39
- DockerFileDevVerifier,
40
- NodeVersionVerifier,
41
- SlugignoreFileVerifier,
42
- GitignoreFileVerifier,
43
- SemaphoreciConfigVerifier,
44
- EnvironmentConfigVerifier,
45
- WebpackConfigurationVerifier,
46
- SidekiqQueuesVerifier,
47
- SimplecovConfigVerifier,
48
- PackageDependenciesVersionVerifier,
49
- PackageJsonVerifier,
50
- CypressConfigVerifier,
51
- # BundlerVersionVerifier,
52
- SyncNeetoCommonsVerifier,
53
- RolesVerifier,
54
- JsconfigVerifier,
55
- AutoUpdatePrsWithLatestMasterVerifier,
56
- CypressPluginsIndexVerifier,
57
- WebpackerConfigVerifier
58
- ]
59
- end
60
- end
61
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module NeetoCompliance
4
- VERSION = "2.0.0"
5
- end