jt_tools 0.0.6 → 0.0.11

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: 4927652633d2fd267f1f2406edc65c94f2dce1f5df0f5114d6a535a50a24cd43
4
- data.tar.gz: 4cdfbc258f01edf7c8c68b6d9e8dc8afe08e83927e1100077bbec7944d99a444
3
+ metadata.gz: ca58ce62c8051fef7f2111b3bdf395730e856c1f9eac7e5a1fa3bd6cb02cfd32
4
+ data.tar.gz: 711f84e4d89e020b559c4ab1314f8b694ca241c214cc0f90045a3bfea3aa6e4a
5
5
  SHA512:
6
- metadata.gz: 7ba9a726ab53e969414f0005f8ccf42fe682f127958a4a39047444830020f481015131cd3b5bbe63d99da13581fb77174ae894f92b54e8d2e932a1e3805adabb
7
- data.tar.gz: 67679d017e44950d99ab4bc819edef9983088de1ebb3483e825dc69108fe6b6bbdb403f76f750ab9a98e0dc15c18a8d5b9689965112d943acfdeff4a4a567901
6
+ metadata.gz: 7e65608ea2fafe9d5801be68214282b649452f50c8b3f058ec87aa0d04c8e86f0b43c1e9ee7631f9a962de383fa59b5396a6f776e43ee2edd8e3bfc2a95b90c0
7
+ data.tar.gz: 68079b100b0be3eddf935aedeb994d62a5f852c7a706590bd4a08968749bcad05de69f95cdf225d2365df6e6b430ba6be711eed5d718ce1e6fed9187c89896b8
data/.gitignore CHANGED
@@ -39,3 +39,4 @@ pkg
39
39
 
40
40
  # Temp files
41
41
  /tmp/
42
+ .rubocop-*
@@ -0,0 +1,10 @@
1
+ default_ignores: false
2
+ #fix: true
3
+ format: progress
4
+ parallel: true
5
+ ruby_version: 2.7.1
6
+
7
+ ignore:
8
+ - 'test/**/*':
9
+ - Layout/AlignHash
10
+ - 'tmp/**/*'
data/Gemfile CHANGED
@@ -1,4 +1,7 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in jt_tools.gemspec
4
4
  gemspec
5
+
6
+ gem "standard"
7
+ gem "bump"
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  [![CircleCI](https://circleci.com/gh/jetthoughts/jt_tools.svg?style=svg)](https://circleci.com/gh/jetthoughts/jt_tools)
2
2
  [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjetthoughts%2Fjt_tools.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjetthoughts%2Fjt_tools?ref=badge_shield)
3
+ [![Gem Version](https://badge.fury.io/rb/jt_tools.svg)](https://badge.fury.io/rb/jt_tools)
3
4
 
4
5
  # JetThoughts Tools
5
6
 
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
- require 'rake/testtask'
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
5
 
6
6
  Rake::TestTask.new(:test) do |t|
7
- t.libs << 'test'
8
- t.libs << 'lib'
9
- t.test_files = FileList['test/**/*_test.rb']
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
10
  end
11
11
 
12
12
  task default: :test
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'standardrb' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("standard", "standardrb")
data/bin/test CHANGED
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- set -xeo pipefail
3
+ set -eo pipefail
4
4
 
5
- echo "=> Yamllint:"
5
+ echo ""
6
+ echo "== Yamllint: =="
6
7
  yamllint --config-file lib/install/.yamllint.yml --strict .*/*.yml
7
8
  yamllint --config-file lib/install/.yamllint.yml --strict *.yml
8
9
  yamllint --config-file lib/install/.yamllint.yml --strict lib/**/.*.yml
@@ -16,25 +17,29 @@ rm -rf test_tmpl
16
17
  # Test installation of missed gems on applying template
17
18
  gem uninstall oj || true
18
19
 
19
- if [[ "TEST_APP_TEMPLATE" == "true" ]]
20
+ if [[ "$TEST_APP_TEMPLATE" == "true" ]]
20
21
  then
21
22
  rails new test_tmpl --quiet --database postgresql
22
23
  cd test_tmpl
23
- rails app:template LOCATION=../template.rb
24
+ bin/setup
25
+ bin/rails app:template LOCATION="../../template.rb"
24
26
  else
25
27
  rails new test_tmpl --template ../template.rb --quiet --database postgresql
26
28
  cd test_tmpl
27
- DISABLE_SPRING=1 bin/setup
29
+ bin/setup
28
30
  fi
29
31
 
30
- echo " => Verify CircleCI config:"
32
+ echo ""
33
+ echo "== Verify CircleCI config =="
31
34
  circleci config validate
32
35
 
33
- echo " => Verify installation scripts:"
36
+ echo ""
37
+ echo "== Verify installation scripts =="
34
38
  bin/tools-setup
35
39
  bin/tools-upgrade
36
40
 
37
- echo " => Verify linters setup:"
41
+ echo ""
42
+ echo "== Verify linters setup =="
38
43
 
39
44
  git add .
40
45
  git commit -m 'Initial Commit'
@@ -50,11 +55,13 @@ git commit -m 'Adds sample_for_linters'
50
55
  bin/rubocop --fail-level F sample_for_linters.rb
51
56
  bin/pronto run -c HEAD~1 --no-exit-code
52
57
  BUNDLE_GEMFILE=Gemfile.tools bin/bundle exec rails_best_practices --without-color --silent --test .
53
- BUNDLE_GEMFILE=Gemfile.tools bin/bundle exec erblint --config ../../lib/install/.erb-lint.yml --autocorrect .
58
+ # FIXME: https://github.com/Shopify/erb-lint/issues/162
59
+ # BUNDLE_GEMFILE=Gemfile.tools bin/bundle exec erblint --config ../../lib/install/.erb-lint.yml --autocorrect .
54
60
 
55
61
  CIRCLECI=false bin/lint-pr -f text
56
62
 
57
- echo " => Run git hooks verifications"
63
+ echo ""
64
+ echo "== Run git hooks verifications =="
58
65
  bin/git-hooks/post-merge
59
66
  CIRCLECI=false bin/git-hooks/pre-push
60
67
 
@@ -1,25 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'jt_tools/version'
5
+ require "jt_tools/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'jt_tools'
8
+ spec.name = "jt_tools"
9
9
  spec.version = JtTools::VERSION
10
- spec.authors = ['Paul Keen']
11
- spec.email = ['pftg@users.noreply.github.com']
10
+ spec.authors = ["Paul Keen"]
11
+ spec.email = ["pftg@users.noreply.github.com"]
12
12
 
13
- spec.summary = 'Setup development scripts to manage code base effectively'
14
- spec.description = 'Helpful scripts to run linters locally and on CI'
15
- spec.homepage = 'https://jtway.co'
16
- spec.license = 'MIT'
13
+ spec.summary = "Setup development scripts to manage code base effectively"
14
+ spec.description = "Helpful scripts to run linters locally and on CI"
15
+ spec.homepage = "https://jtway.co"
16
+ spec.license = "MIT"
17
17
 
18
- spec.metadata['homepage_uri'] = spec.homepage
19
- spec.metadata['source_code_uri'] = 'https://github.com/jetthoughts/jt-tools/'
20
- spec.metadata['changelog_uri'] = 'https://github.com/jetthoughts/jt-tools/'
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = "https://github.com/jetthoughts/jt-tools/"
20
+ spec.metadata["changelog_uri"] = "https://github.com/jetthoughts/jt-tools/"
21
21
 
22
- spec.add_dependency 'railties', '>= 4.2'
22
+ spec.add_dependency "railties", ">= 4.2"
23
23
 
24
24
  # Specify which files should be added to the gem when it is released.
25
25
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
28
  end
29
29
 
30
- spec.require_paths = ['lib']
30
+ spec.require_paths = ["lib"]
31
31
  end
@@ -7,8 +7,8 @@
7
7
  version: 2.1
8
8
 
9
9
  orbs:
10
- ruby: circleci/ruby@1.0.0
11
- node: circleci/node@2.1.1
10
+ ruby: circleci/ruby@1.0.5
11
+ node: circleci/node@3.0.1
12
12
 
13
13
  workflows:
14
14
  version: 2
@@ -61,15 +61,28 @@ jobs:
61
61
 
62
62
  steps:
63
63
  - checkout
64
+
65
+ - restore_cache:
66
+ name: Restore Bundler Cache between Branches
67
+ keys:
68
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
69
+ - v1-dependencies-
70
+
64
71
  - ruby/install-deps:
65
72
  bundler-version: '`cat Gemfile.lock | tail -1 | tr -d " "`'
66
73
  key: v1-dependencies
67
- - node/install:
68
- node-version: latest
74
+ with-cache: false
75
+ path: './vendor/bundle'
76
+
77
+ - save_cache:
78
+ name: Save Bundler Cache between Branches
79
+ paths:
80
+ - ./vendor/bundle
81
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
82
+
69
83
  - node/install-packages:
70
84
  app-dir: .
71
85
  pkg-manager: yarn
72
- cache-key: yarn.lock
73
86
  cache-version: v1
74
87
 
75
88
  - restore_cache:
@@ -77,7 +90,7 @@ jobs:
77
90
  - asset-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ .Environment.CIRCLE_SHA1 }}
78
91
  - asset-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}-
79
92
  - asset-cache-v1-{{ arch }}-{{ .Branch }}-
80
- - asset-cache-v1-
93
+ - asset-cache-v1-{{ arch }}-master-
81
94
 
82
95
  - run:
83
96
  name: Precompile Assets
@@ -143,9 +156,9 @@ jobs:
143
156
 
144
157
  - run:
145
158
  name: Install cmake for building pronto dependencies
146
- command: sudo apt-get update -qq &&
147
- sudo apt-get install -yq --no-install-recommends
148
- cmake yamllint python3-setuptools python3-pkg-resources pkg-config
159
+ command: sudo apt-get update -qq
160
+ && sudo apt-get install -yq --no-install-recommends
161
+ cmake yamllint python3-setuptools python3-pkg-resources pkg-config
149
162
 
150
163
  - run:
151
164
  name: Install Bundle Dependencies
@@ -182,9 +195,11 @@ jobs:
182
195
  source $BASH_ENV
183
196
  gem install bundler:$BUNDLER_VERSION
184
197
 
185
- - run: sudo apt-get update && sudo apt-get install cmake yamllint python3-setuptools python3-pkg-resources
198
+ - run:
199
+ name: Install System Dependencies
200
+ command: sudo apt-get update
201
+ && sudo apt-get install cmake yamllint python3-setuptools python3-pkg-resources pkg-config
186
202
 
187
203
  - run:
188
204
  name: Run Gemfile tools update in separate branch
189
- command: |
190
- ./bin/circleci-auto_upgrade_tools
205
+ command: ./bin/circleci-auto_upgrade_tools
@@ -15,268 +15,37 @@ ij_continuation_indent_size = 2
15
15
  ij_css_align_closing_brace_with_properties = false
16
16
  ij_css_blank_lines_around_nested_selector = 1
17
17
  ij_css_blank_lines_between_blocks = 1
18
- # ij_css_brace_placement = 0
19
- # ij_css_enforce_quotes_on_format = false
20
- # ij_css_hex_color_long_format = false
21
- # ij_css_hex_color_lower_case = false
22
- # ij_css_hex_color_short_format = false
23
- # ij_css_hex_color_upper_case = false
24
18
  ij_css_keep_blank_lines_in_code = 2
25
- # ij_css_keep_indents_on_empty_lines = false
26
- # ij_css_keep_single_line_blocks = false
27
19
  ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
28
- # ij_css_space_after_colon = true
29
- # ij_css_space_before_opening_brace = true
30
- # ij_css_use_double_quotes = true
31
- # ij_css_value_alignment = 0
32
20
 
33
21
  [*.haml]
34
22
  tab_width = 2
35
23
  ij_haml_keep_indents_on_empty_lines = false
36
24
 
37
25
  [*.properties]
38
- # ij_properties_align_group_field_declarations = false
39
26
 
40
27
  [*.scss]
41
28
  ij_continuation_indent_size = 2
42
29
  ij_scss_align_closing_brace_with_properties = false
43
30
  ij_scss_blank_lines_around_nested_selector = 1
44
31
  ij_scss_blank_lines_between_blocks = 1
45
- # ij_scss_brace_placement = 0
46
- # ij_scss_enforce_quotes_on_format = false
47
- # ij_scss_hex_color_long_format = false
48
- # ij_scss_hex_color_lower_case = false
49
- # ij_scss_hex_color_short_format = false
50
- # ij_scss_hex_color_upper_case = false
51
- # ij_scss_keep_blank_lines_in_code = 2
52
- # ij_scss_keep_indents_on_empty_lines = false
53
- # ij_scss_keep_single_line_blocks = false
54
- # ij_scss_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
55
- # ij_scss_space_after_colon = true
56
- # ij_scss_space_before_opening_brace = true
57
- # ij_scss_use_double_quotes = true
58
- # ij_scss_value_alignment = 0
59
32
 
60
33
  [.editorconfig]
61
- # ij_editorconfig_align_group_field_declarations = true
62
- # ij_editorconfig_space_after_colon = true
63
- # ij_editorconfig_space_after_comma = true
64
- # ij_editorconfig_space_before_colon = false
65
- # ij_editorconfig_space_before_comma = false
66
- # ij_editorconfig_spaces_around_assignment_operators = true
67
34
 
68
35
  [{*.js,*.cjs}]
69
36
  ij_continuation_indent_size = 2
70
- # ij_javascript_align_imports = false
71
- # ij_javascript_align_multiline_array_initializer_expression = false
72
- # ij_javascript_align_multiline_binary_operation = false
73
- # ij_javascript_align_multiline_chained_methods = false
74
- # ij_javascript_align_multiline_extends_list = false
75
- # ij_javascript_align_multiline_for = false
76
- # ij_javascript_align_multiline_parameters = false
77
- # ij_javascript_align_multiline_parameters_in_calls = false
78
- # ij_javascript_align_multiline_ternary_operation = false
79
- # ij_javascript_align_object_properties = 0
80
- # ij_javascript_align_union_types = false
81
- # ij_javascript_align_var_statements = 0
82
- # ij_javascript_array_initializer_new_line_after_left_brace = false
83
- # ij_javascript_array_initializer_right_brace_on_new_line = false
84
- # ij_javascript_array_initializer_wrap = off
85
- # ij_javascript_assignment_wrap = off
86
- # ij_javascript_binary_operation_sign_on_next_line = false
87
- # ij_javascript_binary_operation_wrap = off
88
- # ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**/*,@angular/material,@angular/material/typings/**
89
- # ij_javascript_blank_lines_after_imports = 1
90
- # ij_javascript_blank_lines_around_class = 1
91
- # ij_javascript_blank_lines_around_field = 0
92
- # ij_javascript_blank_lines_around_function = 1
93
- # ij_javascript_blank_lines_around_method = 1
94
- # ij_javascript_block_brace_style = end_of_line
95
- # ij_javascript_call_parameters_new_line_after_left_paren = false
96
- # ij_javascript_call_parameters_right_paren_on_new_line = false
97
- # ij_javascript_call_parameters_wrap = off
98
- # ij_javascript_catch_on_new_line = false
99
- # ij_javascript_chained_call_dot_on_new_line = true
100
- # ij_javascript_class_brace_style = end_of_line
101
- # ij_javascript_comma_on_new_line = false
102
- # ij_javascript_do_while_brace_force = never
103
- # ij_javascript_else_on_new_line = false
104
- # ij_javascript_enforce_trailing_comma = keep
105
- # ij_javascript_extends_keyword_wrap = off
106
- # ij_javascript_extends_list_wrap = off
107
- # ij_javascript_field_prefix = _
108
- # ij_javascript_file_name_style = relaxed
109
- # ij_javascript_finally_on_new_line = false
110
- # ij_javascript_for_brace_force = never
111
- # ij_javascript_for_statement_new_line_after_left_paren = false
112
- # ij_javascript_for_statement_right_paren_on_new_line = false
113
- # ij_javascript_for_statement_wrap = off
114
- # ij_javascript_force_quote_style = true
115
- # ij_javascript_force_semicolon_style = true
116
- # ij_javascript_function_expression_brace_style = end_of_line
117
- # ij_javascript_if_brace_force = never
118
- # ij_javascript_import_merge_members = global
119
- # ij_javascript_import_prefer_absolute_path = global
120
- # ij_javascript_import_sort_members = true
121
- # ij_javascript_import_sort_module_name = false
122
- # ij_javascript_import_use_node_resolution = true
123
- # ij_javascript_imports_wrap = on_every_item
124
- # ij_javascript_indent_case_from_switch = true
125
- # ij_javascript_indent_chained_calls = true
126
- # ij_javascript_indent_package_children = 0
127
- # ij_javascript_jsx_attribute_value = braces
128
- # ij_javascript_keep_blank_lines_in_code = 1
129
- # ij_javascript_keep_first_column_comment = true
130
- # ij_javascript_keep_indents_on_empty_lines = false
131
- # ij_javascript_keep_line_breaks = true
132
- # ij_javascript_keep_simple_blocks_in_one_line = true
133
- # ij_javascript_keep_simple_methods_in_one_line = true
134
- # ij_javascript_line_comment_add_space = true
135
- # ij_javascript_line_comment_at_first_column = false
136
- # ij_javascript_method_brace_style = end_of_line
137
- # ij_javascript_method_call_chain_wrap = off
138
- # ij_javascript_method_parameters_new_line_after_left_paren = false
139
- # ij_javascript_method_parameters_right_paren_on_new_line = false
140
- # ij_javascript_method_parameters_wrap = off
141
- # ij_javascript_object_literal_wrap = on_every_item
142
- # ij_javascript_parentheses_expression_new_line_after_left_paren = false
143
- # ij_javascript_parentheses_expression_right_paren_on_new_line = false
144
- # ij_javascript_place_assignment_sign_on_next_line = false
145
- # ij_javascript_prefer_as_type_cast = false
146
- # ij_javascript_prefer_parameters_wrap = false
147
- # ij_javascript_reformat_c_style_comments = false
148
- # ij_javascript_space_after_colon = true
149
- # ij_javascript_space_after_comma = true
150
- # ij_javascript_space_after_dots_in_rest_parameter = false
151
- # ij_javascript_space_after_generator_mult = true
152
- # ij_javascript_space_after_property_colon = true
153
- # ij_javascript_space_after_quest = true
154
- # ij_javascript_space_after_type_colon = true
155
- # ij_javascript_space_after_unary_not = false
156
- # ij_javascript_space_before_async_arrow_lparen = true
157
- # ij_javascript_space_before_catch_keyword = true
158
- # ij_javascript_space_before_catch_left_brace = true
159
- # ij_javascript_space_before_catch_parentheses = true
160
- # ij_javascript_space_before_class_lbrace = true
161
- # ij_javascript_space_before_class_left_brace = true
162
- # ij_javascript_space_before_colon = true
163
- # ij_javascript_space_before_comma = false
164
- # ij_javascript_space_before_do_left_brace = true
165
- # ij_javascript_space_before_else_keyword = true
166
- # ij_javascript_space_before_else_left_brace = true
167
- # ij_javascript_space_before_finally_keyword = true
168
- # ij_javascript_space_before_finally_left_brace = true
169
- # ij_javascript_space_before_for_left_brace = true
170
- # ij_javascript_space_before_for_parentheses = true
171
- # ij_javascript_space_before_for_semicolon = false
172
- # ij_javascript_space_before_function_left_parenth = true
173
- # ij_javascript_space_before_generator_mult = true
174
- # ij_javascript_space_before_if_left_brace = true
175
- # ij_javascript_space_before_if_parentheses = true
176
- # ij_javascript_space_before_method_call_parentheses = false
177
- # ij_javascript_space_before_method_left_brace = true
178
- # ij_javascript_space_before_method_parentheses = true
179
- # ij_javascript_space_before_property_colon = false
180
- # ij_javascript_space_before_quest = true
181
- # ij_javascript_space_before_switch_left_brace = true
182
- # ij_javascript_space_before_switch_parentheses = true
183
- # ij_javascript_space_before_try_left_brace = true
184
- # ij_javascript_space_before_type_colon = false
185
- # ij_javascript_space_before_unary_not = false
186
- # ij_javascript_space_before_while_keyword = true
187
- # ij_javascript_space_before_while_left_brace = true
188
- # ij_javascript_space_before_while_parentheses = true
189
- # ij_javascript_spaces_around_additive_operators = true
190
- # ij_javascript_spaces_around_arrow_function_operator = true
191
- # ij_javascript_spaces_around_assignment_operators = true
192
- # ij_javascript_spaces_around_bitwise_operators = true
193
- # ij_javascript_spaces_around_equality_operators = true
194
- # ij_javascript_spaces_around_logical_operators = true
195
- # ij_javascript_spaces_around_multiplicative_operators = true
196
- # ij_javascript_spaces_around_relational_operators = true
197
- # ij_javascript_spaces_around_shift_operators = true
198
- # ij_javascript_spaces_around_unary_operator = false
199
- # ij_javascript_spaces_within_array_initializer_brackets = false
200
- # ij_javascript_spaces_within_brackets = false
201
- # ij_javascript_spaces_within_catch_parentheses = false
202
- # ij_javascript_spaces_within_for_parentheses = false
203
- # ij_javascript_spaces_within_if_parentheses = false
204
- # ij_javascript_spaces_within_imports = true
205
- # ij_javascript_spaces_within_interpolation_expressions = false
206
- # ij_javascript_spaces_within_method_call_parentheses = false
207
- # ij_javascript_spaces_within_method_parentheses = false
208
- # ij_javascript_spaces_within_object_literal_braces = true
209
- # ij_javascript_spaces_within_object_type_braces = true
210
- # ij_javascript_spaces_within_parentheses = false
211
- # ij_javascript_spaces_within_switch_parentheses = false
212
- # ij_javascript_spaces_within_type_assertion = false
213
- # ij_javascript_spaces_within_union_types = true
214
- # ij_javascript_spaces_within_while_parentheses = false
215
- # ij_javascript_special_else_if_treatment = true
216
- # ij_javascript_ternary_operation_signs_on_next_line = true
217
- # ij_javascript_ternary_operation_wrap = off
218
- # ij_javascript_union_types_wrap = on_every_item
219
- # ij_javascript_use_chained_calls_group_indents = false
220
- # ij_javascript_use_double_quotes = false
221
- # ij_javascript_use_explicit_js_extension = global
222
- # ij_javascript_use_path_mapping = always
223
- # ij_javascript_use_public_modifier = false
224
- # ij_javascript_use_semicolon_after_statement = false
225
- # ij_javascript_var_declaration_wrap = normal
226
- # ij_javascript_while_brace_force = never
227
- # ij_javascript_while_on_new_line = false
228
- # ij_javascript_wrap_comments = false
229
37
 
230
38
  [{*.sht,*.html,*.shtm,*.shtml,*.htm}]
231
39
  ij_continuation_indent_size = 2
232
- # ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
233
- # ij_html_align_attributes = true
234
- # ij_html_align_text = false
235
- # ij_html_attribute_wrap = normal
236
- # ij_html_block_comment_at_first_column = true
237
- # ij_html_do_not_align_children_of_min_lines = 0
238
- # ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
239
- # ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot,script,style
240
- # ij_html_enforce_quotes = false
241
- # ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
242
- # ij_html_keep_blank_lines = 2
243
- # ij_html_keep_indents_on_empty_lines = false
244
- # ij_html_keep_line_breaks = true
245
- # ij_html_keep_line_breaks_in_text = true
246
- # ij_html_keep_whitespaces = false
247
- # ij_html_keep_whitespaces_inside = span,pre,textarea
248
- # ij_html_line_comment_at_first_column = true
249
- # ij_html_new_line_after_last_attribute = never
250
- # ij_html_new_line_before_first_attribute = never
251
- # ij_html_quote_style = double
252
- # ij_html_remove_new_line_before_tags = br
253
- # ij_html_space_after_tag_name = false
254
- # ij_html_space_around_equality_in_attribute = false
255
- # ij_html_space_inside_empty_tag = true
256
- # ij_html_text_wrap = normal
257
40
 
258
41
  [{*.xslt,*.rng,*.ant,*.xsl,*.xsd,*.xul,*.jhm,*.xml,*.tld,*.fxml,*.wsdl,*.jrxml,*.jnlp}]
259
42
  tab_width = 2
260
- # ij_xml_block_comment_at_first_column = true
261
- # ij_xml_keep_indents_on_empty_lines = false
262
- # ij_xml_line_comment_at_first_column = true
263
43
 
264
44
  [{*.yml,*.yaml}]
265
- # ij_yaml_keep_indents_on_empty_lines = false
266
- # ij_yaml_keep_line_breaks = true
45
+ tab_width = 2
267
46
 
268
47
  [{.babelrc,.stylelintrc,.eslintrc,jest.config,.resultset.json.lock,bowerrc,*.json,*.jsb3,*.jsb2}]
269
48
  tab_width = 2
270
- # ij_json_keep_blank_lines_in_code = 0
271
- # ij_json_keep_indents_on_empty_lines = false
272
- # ij_json_keep_line_breaks = true
273
- # ij_json_space_after_colon = true
274
- # ij_json_space_after_comma = true
275
- # ij_json_space_before_colon = true
276
- # ij_json_space_before_comma = false
277
- # ij_json_spaces_within_braces = false
278
- # ij_json_spaces_within_brackets = false
279
- # ij_json_wrap_long_lines = false
280
49
 
281
50
  [{Podfile,Brewfile,cucumber,yarn,spork,Gemfile.tools,rake,.simplecov,rcov,rails,spec,capfile,gemfile,rakefile,guardfile,isolate,vagrantfile,*.gemspec,*.jbuilder,*.thor,*.rbw,*.ru,*.rb,*.rake}]
282
51
  ij_ruby_align_group_field_declarations = false
@@ -10,17 +10,17 @@ linters:
10
10
  - .rubocop.yml
11
11
  Layout/InitialIndentation:
12
12
  Enabled: false
13
+ Layout/LineLength:
14
+ Enabled: false
13
15
  Layout/TrailingEmptyLines:
14
16
  Enabled: false
15
17
  Layout/TrailingWhitespace:
16
18
  Enabled: false
17
- Naming/FileName:
18
- Enabled: false
19
- Style/FrozenStringLiteralComment:
20
- Enabled: false
21
- Layout/LineLength:
22
- Enabled: false
23
19
  Lint/UselessAssignment:
24
20
  Enabled: false
21
+ Naming/FileName:
22
+ Enabled: false
25
23
  Rails/OutputSafety:
26
24
  Enabled: false
25
+ Style/FrozenStringLiteralComment:
26
+ Enabled: false
@@ -1,28 +1,29 @@
1
1
  ---
2
2
  require:
3
- - rubocop-performance
3
+ - standard
4
4
  - rubocop-rails
5
5
 
6
+ inherit_gem:
7
+ standard: config/base.yml
8
+
6
9
  AllCops:
7
10
  TargetRubyVersion: 2.7
11
+
8
12
  Exclude:
9
13
  - 'db/migrate/**/*'
10
14
  - 'db/schema.rb'
15
+ - 'vendor/**/*'
11
16
 
12
- Layout/EmptyLinesAroundAttributeAccessor:
17
+ Bundler/InsecureProtocolSource:
13
18
  Enabled: true
19
+ Include:
20
+ - '**/*.gemfile'
21
+ - '**/Gemfile'
22
+ - '**/Gemfile.tools'
23
+ - '**/gems.rb'
14
24
 
15
- Layout/EmptyLinesAroundBlockBody:
16
- Exclude:
17
- - 'db/schema.rb'
18
-
19
- Layout/FirstHashElementIndentation:
20
- EnforcedStyle: consistent
21
-
22
- Layout/HashAlignment:
23
- EnforcedHashRocketStyle: table
24
- EnforcedColonStyle: table
25
- EnforcedLastArgumentHashStyle: always_inspect
25
+ Layout/EmptyLinesAroundAttributeAccessor:
26
+ Enabled: true
26
27
 
27
28
  Layout/LineLength:
28
29
  Max: 113
@@ -30,30 +31,9 @@ Layout/LineLength:
30
31
  Layout/MultilineMethodArgumentLineBreaks:
31
32
  Enabled: true
32
33
 
33
- Layout/MultilineMethodCallBraceLayout:
34
- EnforcedStyle: symmetrical
35
-
36
- Layout/MultilineMethodCallIndentation:
37
- EnforcedStyle: indented
38
-
39
- Layout/MultilineOperationIndentation:
40
- EnforcedStyle: indented
41
-
42
- Layout/ParameterAlignment:
43
- EnforcedStyle: with_fixed_indentation
44
-
45
- Layout/SpaceAroundMethodCallOperator:
46
- Enabled: true
47
-
48
34
  Layout/SpaceInLambdaLiteral:
49
35
  EnforcedStyle: require_space
50
36
 
51
- Lint/DeprecatedOpenSSLConstant:
52
- Enabled: true
53
-
54
- Lint/RaiseException:
55
- Enabled: true
56
-
57
37
  Lint/StructNewOverride:
58
38
  Enabled: true
59
39
 
@@ -105,22 +85,9 @@ Style/HashTransformKeys:
105
85
  Style/HashTransformValues:
106
86
  Enabled: true
107
87
 
108
- Style/SafeNavigation:
109
- Enabled: false
110
-
111
88
  Style/SlicingWithRange:
112
89
  Enabled: true
113
90
 
114
- Style/StabbyLambdaParentheses:
115
- EnforcedStyle: require_no_parentheses
116
-
117
- Style/StringLiterals:
118
- Exclude:
119
- - 'db/schema.rb'
120
-
121
- Style/TrailingCommaInHashLiteral:
122
- EnforcedStyleForMultiline: consistent_comma
123
-
124
91
  # Rails
125
92
 
126
93
  Rails:
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if defined?(Spring) && ENV['DISABLE_SPRING'].nil?
4
- puts '**** NO COVERAGE FOR YOU! ****'
5
- puts 'Please disable Spring to get COVERAGE by `DISABLE_SPRING=1 COVERAGE=1 bin/rspec`'
3
+ if defined?(Spring) && ENV["DISABLE_SPRING"].nil?
4
+ puts "**** NO COVERAGE FOR YOU! ****"
5
+ puts "Please disable Spring to get COVERAGE by `DISABLE_SPRING=1 COVERAGE=1 bin/rspec`"
6
6
  else
7
- SimpleCov.start 'rails' do
7
+ SimpleCov.start "rails" do
8
8
  add_filter %w[app/views bin spec test]
9
9
 
10
10
  maximum_coverage_drop 0.5
11
11
  end
12
12
 
13
- if ENV['CODECOV_TOKEN']
14
- require 'codecov'
13
+ if ENV["CODECOV_TOKEN"]
14
+ require "codecov"
15
15
  SimpleCov.formatter = SimpleCov::Formatter::Codecov
16
16
  end
17
17
  end
@@ -1,17 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- tap 'caskroom/cask'
4
- cask_args appdir: '/Applications'
3
+ tap "heroku/brew"
5
4
 
6
- tap 'heroku/brew'
7
-
8
- brew 'circleci'
9
- brew 'graphicsmagick' # For ActiveStorage
10
- brew 'heroku'
11
- brew 'hub' # For creating Pull Request from CLI
12
- brew 'postgresql'
13
- brew 'rbenv'
14
- brew 'ruby-build'
15
- brew 'vips' # For ActiveStorage
16
- brew 'yamllint' # For Linters
17
- brew 'yarn'
5
+ brew "circleci"
6
+ brew "graphicsmagick" # For ActiveStorage
7
+ brew "heroku"
8
+ brew "hub" # For creating Pull Request from CLI
9
+ brew "postgresql"
10
+ brew "rbenv"
11
+ brew "ruby-build"
12
+ brew "vips" # For ActiveStorage
13
+ brew "yamllint" # For Linters
14
+ brew "yarn"
@@ -18,8 +18,11 @@ group :tools do
18
18
  gem 'pronto-rails_best_practices', require: false
19
19
  gem 'pronto-reek', require: false
20
20
  gem 'pronto-rubocop', require: false
21
+ # gem 'pronto-standardrb', require: false
21
22
  gem 'pronto-yamllint', require: false
22
23
 
23
- gem 'rubocop-performance', require: false
24
+ # gem 'rubocop-minitest', require: false
24
25
  gem 'rubocop-rails', require: false
26
+ # gem 'rubocop-rspec', require: false
27
+ gem 'standard', '>= 0.4.7', require: false
25
28
  end
@@ -1,11 +1,11 @@
1
1
  {
2
- "name": "APP NAME",
3
2
  "scripts": {
4
3
  "postdeploy": "bin/heroku-postdeploy"
5
4
  },
6
5
  "env": {
7
6
  "BUNDLE_WITHOUT": "development:test:production",
8
7
  "DISABLE_DATABASE_ENVIRONMENT_CHECK": "1",
8
+ "JEMALLOC_ENABLED": "true",
9
9
  "LANG": "en_US.UTF-8",
10
10
  "MALLOC_ARENA_MAX": "2",
11
11
  "NODE_ENV": "production",
@@ -38,6 +38,9 @@
38
38
  "redistogo:nano"
39
39
  ],
40
40
  "buildpacks": [
41
+ {
42
+ "url": "https://github.com/gaffneyc/heroku-buildpack-jemalloc.git"
43
+ },
41
44
  {
42
45
  "url": "heroku/nodejs"
43
46
  },
@@ -2,7 +2,7 @@
2
2
 
3
3
  set -eo pipefail
4
4
 
5
- bin/lint-pr
5
+ bin/lint-pr --no-staged
6
6
 
7
7
  # bin/rspec --tag critical
8
8
  # bin/rails test
@@ -4,7 +4,7 @@ set -eo pipefail
4
4
 
5
5
  reporters_opt=""
6
6
 
7
- if [[ "$CIRCLECI" == "true" ]]
7
+ if [[ -n "$PRONTO_GITHUB_ACCESS_TOKEN" && "$CIRCLECI" == "true" ]]
8
8
  then
9
9
  git fetch origin master
10
10
  reporters_opt="-f github_status github_pr_review"
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- set -e
3
+ set -eo pipefail
4
+
5
+ ([[ (-x "$(command -v brew)") ]] && brew bundle check || brew bundle --no-lock) \
6
+ || (echo "*** Please install manually system dependencies: ***" && cat Brewfile)
4
7
 
5
8
  export BUNDLE_GEMFILE=Gemfile.tools
6
9
 
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- set -e
3
+ set -eo pipefail
4
+
5
+ ([[ (-x "$(command -v brew)") ]] && brew bundle check || brew bundle --no-lock) \
6
+ || (echo "*** Please upgrade manually system dependencies: ***" && cat Brewfile)
4
7
 
5
8
  export BUNDLE_GEMFILE=Gemfile.tools
6
9
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'jt_tools/version'
3
+ require "jt_tools/version"
4
4
 
5
- require 'jt_tools/railtie' if defined?(Rails)
5
+ require "jt_tools/railtie" if defined?(Rails)
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/railtie'
3
+ require "rails/railtie"
4
4
 
5
5
  class JtToolsRailtie < Rails::Railtie
6
6
  rake_tasks do
7
- load 'tasks/install.rake'
7
+ load "tasks/install.rake"
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JtTools
4
- VERSION = '0.0.6'
4
+ VERSION = "0.0.11"
5
5
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- install_template_path = File.expand_path('../../template.rb', __dir__).freeze
4
- bin_path = ENV['BUNDLE_BIN'] || './bin'
3
+ install_template_path = File.expand_path("../../template.rb", __dir__).freeze
4
+ bin_path = ENV["BUNDLE_BIN"] || "./bin"
5
5
 
6
6
  namespace :jt_tools do
7
- desc 'Install jt-tools in this application'
7
+ desc "Install jt-tools in this application"
8
8
  task install: :environment do
9
9
  exec "#{RbConfig.ruby} #{bin_path}/rails app:template LOCATION=#{install_template_path}"
10
10
  end
@@ -1,18 +1,17 @@
1
-
2
- require 'json'
1
+ require "json"
3
2
 
4
3
  EXTRACT_DEPENDENCY_NAME = /"?(.+?)@.+?"?(?:,\s+|\Z)/.freeze
5
4
  EXTRACT_DEPENDENCY_DETAILS = /(^((?!= ).*?):\n.*?(?:\n\n|\Z))/m.freeze
6
5
 
7
6
  def direct_dependencies_names
8
- package_json = JSON.parse(File.open('package.json').read)
9
- direct_dependencies = package_json.fetch_values('dependencies', 'devDependencies', 'peerDependencies') { }
7
+ package_json = JSON.parse(File.open("package.json").read)
8
+ direct_dependencies = package_json.fetch_values("dependencies", "devDependencies", "peerDependencies") {}
10
9
  direct_dependencies.compact.inject([]) { |memo, v| memo.concat(v.keys) }
11
10
  end
12
11
 
13
12
  @dependencies = direct_dependencies_names
14
13
 
15
- yarn_lock_content = File.open('yarn.lock').read
14
+ yarn_lock_content = File.open("yarn.lock").read
16
15
  yarn_lock_content.scan(EXTRACT_DEPENDENCY_DETAILS).each do |dependency_block|
17
16
  direct_dep = @dependencies.include?(dependency_block[1].match(EXTRACT_DEPENDENCY_NAME).to_a[1])
18
17
  puts dependency_block[0] if direct_dep
@@ -0,0 +1 @@
1
+ # use defaults
@@ -7,17 +7,17 @@
7
7
  # In that case, use `git clone` to download them to a local temporary dir.
8
8
  def add_template_repository_to_source_path
9
9
  if __FILE__.match?(%r{\Ahttps?://})
10
- require 'shellwords'
11
- require 'tmpdir'
10
+ require "shellwords"
11
+ require "tmpdir"
12
12
 
13
- source_paths.unshift(temp_dir = Dir.mktmpdir('jt_tools-'))
13
+ source_paths.unshift(temp_dir = Dir.mktmpdir("jt_tools-"))
14
14
  at_exit { FileUtils.remove_entry(temp_dir) }
15
15
  git clone: [
16
- '--quiet',
17
- 'https://github.com/jetthoughts/jt_tools.git',
16
+ "--quiet",
17
+ "https://github.com/jetthoughts/jt_tools.git",
18
18
  temp_dir
19
19
  ].map { |args| Shellwords.escape(args) }
20
- .join(' ')
20
+ .join(" ")
21
21
 
22
22
  if (branch = __FILE__[%r{jt_tools/(.+)/template.rb}, 1])
23
23
  Dir.chdir(temp_dir) { git checkout: branch }
@@ -29,131 +29,135 @@ end
29
29
 
30
30
  add_template_repository_to_source_path
31
31
 
32
- say '=> Copying binstubs'
33
- directory 'lib/install/bin', 'bin'
32
+ say "=> Copying binstubs"
33
+ directory "lib/install/bin", "bin"
34
34
 
35
- chmod 'bin', 0o755 & ~File.umask, verbose: false
35
+ chmod "bin", 0o755 & ~File.umask, verbose: false
36
36
 
37
- say '=> Copying tools gemfile'
38
- copy_file 'lib/install/Gemfile.tools', 'Gemfile.tools'
37
+ say "=> Copying tools gemfile"
38
+ copy_file "lib/install/Gemfile.tools", "Gemfile.tools"
39
39
 
40
- run 'yarn add -D eslint jest-junit'
40
+ run "yarn add -D eslint jest-junit"
41
41
 
42
- say 'Copying lint configurations'
43
- copy_file 'lib/install/.better-html.yml', '.better-html.yml'
44
- copy_file 'lib/install/.erb-lint.yml', '.erb-lint.yml'
45
- copy_file 'lib/install/.eslintrc.js', '.eslintrc.js'
46
- copy_file 'lib/install/.pronto.yml', '.pronto.yml'
47
- copy_file 'lib/install/.pronto_eslint_npm.yml', '.pronto_eslint_npm.yml'
48
- copy_file 'lib/install/.rubocop.yml', '.rubocop.yml'
49
- copy_file 'lib/install/.yamllint.yml', '.yamllint.yml'
50
- copy_file 'lib/install/.reek.yml', '.reek.yml'
51
- copy_file 'lib/install/config/rails_best_practices.yml', 'config/rails_best_practices.yml'
52
- copy_file 'lib/install/.editorconfig', '.editorconfig'
42
+ say "Copying lint configurations"
43
+ copy_file "lib/install/.better-html.yml", ".better-html.yml"
44
+ copy_file "lib/install/.erb-lint.yml", ".erb-lint.yml"
45
+ copy_file "lib/install/.eslintrc.js", ".eslintrc.js"
46
+ copy_file "lib/install/.pronto.yml", ".pronto.yml"
47
+ copy_file "lib/install/.pronto_eslint_npm.yml", ".pronto_eslint_npm.yml"
48
+ copy_file "lib/install/.rubocop.yml", ".rubocop.yml"
49
+ copy_file "lib/install/.yamllint.yml", ".yamllint.yml"
50
+ copy_file "lib/install/.reek.yml", ".reek.yml"
51
+ copy_file "lib/install/config/rails_best_practices.yml", "config/rails_best_practices.yml"
52
+ copy_file "lib/install/.editorconfig", ".editorconfig"
53
53
 
54
- say '=> Copying services configuration'
55
- copy_file 'lib/install/.simplecov', '.simplecov'
56
- copy_file 'lib/install/codecov.yml', 'codecov.yml'
54
+ say "=> Copying services configuration"
55
+ copy_file "lib/install/.simplecov", ".simplecov"
56
+ copy_file "lib/install/codecov.yml", "codecov.yml"
57
57
 
58
-
59
- say '=> Adds service client API gems'
58
+ say "=> Adds service client API gems"
60
59
 
61
60
  gem_group :test do
62
- gem 'simplecov', require: false, group: :test
63
- gem 'codecov', require: false, group: :test
61
+ gem "simplecov", require: false, group: :test
62
+ gem "codecov", require: false, group: :test
64
63
  end
65
64
 
66
- gem 'oj'
65
+ gem "oj"
67
66
 
68
67
  gem_group :production, :staging do
69
- gem 'dalli'
70
- gem 'r7insight'
71
- gem 'rollbar'
68
+ gem "dalli"
69
+ gem "r7insight"
70
+ gem "rollbar"
72
71
  end
73
72
 
74
- directory 'lib/install/.circleci', '.circleci'
73
+ directory "lib/install/.circleci", ".circleci"
75
74
 
76
- if File.read('Gemfile').include? 'rspec'
77
- gem 'rspec_junit_formatter', require: false, group: :test
75
+ if File.read("Gemfile").include? "rspec"
76
+ gem "rspec_junit_formatter", require: false, group: :test
78
77
  insert_into_file(
79
- 'spec/spec_helper.rb',
78
+ "spec/spec_helper.rb",
80
79
  "require 'simplecov' if ENV['COVERAGE']\n",
81
80
  after: /\A/
82
81
  )
83
82
  insert_into_file(
84
- '.circleci/config.yml',
85
- "\n" + ' - run: bin/rspec --format RspecJunitFormatter --out tmp/reports/rspec-results.xml --format progress',
86
- after: '# rails test'
83
+ ".circleci/config.yml",
84
+ "\n" + " - run: bin/rspec --format RspecJunitFormatter --out tmp/reports/rspec-results.xml --format progress",
85
+ after: "# rails test"
87
86
  )
88
87
  else
89
- gem 'minitest-ci', require: false, group: :test
88
+ gem "minitest-ci", require: false, group: :test
90
89
  insert_into_file(
91
- 'test/test_helper.rb',
90
+ "test/test_helper.rb",
92
91
  "require 'simplecov' if ENV['COVERAGE']\n",
93
92
  after: /\A/
94
93
  )
95
94
  insert_into_file(
96
- '.circleci/config.yml',
95
+ ".circleci/config.yml",
97
96
  "\n" + ' - run: bin/rails test "test/**/*_test.rb"',
98
- after: '# rails test'
97
+ after: "# rails test"
99
98
  )
99
+
100
+ gsub_file "test/test_helper.rb",
101
+ "parallelize(workers: :number_of_processors)",
102
+ "parallelize(workers: :number_of_processors) unless ENV['COVERAGE']"
100
103
  end
101
104
 
102
- directory 'lib/install/.dependabot', '.dependabot'
105
+ directory "lib/install/.dependabot", ".dependabot"
103
106
 
104
- say '=> Copying heroku configuration'
105
- copy_file 'lib/install/app.json', 'app.json'
106
- copy_file 'lib/install/Procfile', 'Procfile'
107
+ say "=> Copying heroku configuration"
108
+ copy_file "lib/install/app.json", "app.json"
109
+ copy_file "lib/install/Procfile", "Procfile"
107
110
 
108
- say '=> Install Brew dependencies'
109
- copy_file 'lib/install/Brewfile', 'Brewfile'
111
+ say "=> Install Brew dependencies"
112
+ copy_file "lib/install/Brewfile", "Brewfile"
110
113
 
111
- say 'Setup git hooks'
112
- directory 'lib/install/bin/git-hooks', 'bin/git-hooks'
114
+ say "Setup git hooks"
115
+ directory "lib/install/bin/git-hooks", "bin/git-hooks"
113
116
 
114
- require 'bundler'
117
+ require "bundler"
115
118
  Bundler.with_original_env do
116
- say '=> Install tools'
117
- run 'bin/tools-setup'
119
+ say "=> Install tools"
120
+ run "bin/tools-setup"
118
121
 
119
- say '=> Generate binstubs for linters'
120
- run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force pronto'
121
- run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force rubocop'
122
+ say "=> Generate binstubs for linters"
123
+ run "BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force pronto"
124
+ run "BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force rubocop"
125
+ run "BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force standard"
122
126
  end
123
127
 
124
- say '=> Set git hooks'
125
- run 'git config core.hooksPath ./bin/git-hooks'
128
+ say "=> Set git hooks"
129
+ run "git config core.hooksPath ./bin/git-hooks"
130
+ say "=> Install all new dependencies"
126
131
 
127
- say '=> Install all new dependencies'
128
132
  run <<~BREW_INSTALL
129
133
  hash brew 2> /dev/null \
130
- && (brew bundle check || brew bundle install) \
134
+ && (brew bundle check || brew bundle install --no-lock) \
131
135
  || echo "Please install Homebrew: https://brew.sh/"
132
136
  BREW_INSTALL
133
137
 
134
- say '=> Update development config'
135
- uncomment_lines 'config/environments/development.rb', /config\.file_watcher = ActiveSupport::EventedFileUpdateChecker/
138
+ say "=> Update development config"
139
+ uncomment_lines "config/environments/development.rb", /config\.file_watcher = ActiveSupport::EventedFileUpdateChecker/
136
140
 
137
- say '=> Set up R7Insight'
141
+ say "=> Set up R7Insight"
138
142
  r7insight_config = <<-CODE
139
143
  if ENV['R7INSIGHT_TOKEN'].present?
140
144
  Rails.logger = R7Insight.new(ENV['R7INSIGHT_TOKEN'], ENV['R7INSIGHT_REGION'])
141
145
  end
142
146
  CODE
143
- insert_into_file 'config/environments/production.rb',
144
- "require 'r7_insight.rb'" + "\n\n",
145
- before: 'Rails.application.configure do'
146
- environment(r7insight_config, env: 'production')
147
- if File.exist?('config/environments/staging.rb')
148
- insert_into_file 'config/environments/staging.rb',
149
- "require 'r7_insight.rb'" + "\n\n",
150
- before: 'Rails.application.configure do'
151
- environment(r7insight_config, env: 'staging')
147
+ insert_into_file "config/environments/production.rb",
148
+ "require 'r7_insight.rb'" + "\n\n",
149
+ before: "Rails.application.configure do"
150
+ environment(r7insight_config, env: "production")
151
+ if File.exist?("config/environments/staging.rb")
152
+ insert_into_file "config/environments/staging.rb",
153
+ "require 'r7_insight.rb'" + "\n\n",
154
+ before: "Rails.application.configure do"
155
+ environment(r7insight_config, env: "staging")
152
156
  end
153
157
 
154
- gem 'connection_pool'
158
+ gem "connection_pool"
155
159
 
156
- say '=> Set up Memcachier'
160
+ say "=> Set up Memcachier"
157
161
  memcachier_config = <<-CODE
158
162
  if ENV["MEMCACHIER_SERVERS"]
159
163
  config.cache_store = :mem_cache_store,
@@ -165,31 +169,40 @@ memcachier_config = <<-CODE
165
169
  end
166
170
 
167
171
  CODE
168
- environment(memcachier_config, env: 'production')
169
- if File.exist?('config/environments/staging.rb')
170
- environment(memcachier_config, env: 'staging')
172
+ environment(memcachier_config, env: "production")
173
+ if File.exist?("config/environments/staging.rb")
174
+ environment(memcachier_config, env: "staging")
171
175
  end
172
176
 
177
+ Bundler.with_original_env do
178
+ say "=> Setup default bundle config"
179
+ run "bundle config jobs 4"
180
+ run "bundle config retry 3"
173
181
 
174
- after_bundle do
175
- say '=> Setup default bundle config'
176
- run 'bundle config jobs 4'
177
- run 'bundle config retry 3'
182
+ run "bundle"
178
183
  end
179
184
 
180
- say '**************************************************************************'
181
- say '**************************************************************************'
182
- say ''
183
- say '1. Recommended Heroku Addons: Mailtrap, Rollbar, Cloudinary'
184
- say ''
185
- say '2. Setup Git Hooks to auto-check code and cleanup staled branches:'
186
- say '$ `git config core.hooksPath bin/git-hooks`'
187
- say ''
188
- say '3. Please, set CODECOV_TOKEN, GITHUB_TOKEN and PRONTO_GITHUB_ACCESS_TOKEN'
189
- say 'environment variables in CircleCI and your local env'
190
- say ''
191
- say ' For code coverage report aggregator, running code static analysis'
192
- say 'and auto-update of the tools.'
193
- say ''
194
- say '**************************************************************************'
195
- say '**************************************************************************'
185
+ uncomment_lines "bin/setup", /system\(.*?\\byarn\b/
186
+
187
+ insert_into_file(
188
+ "bin/setup",
189
+ "system!('bin/tools-setup')\n",
190
+ after: "system('bundle check') || system!('bundle install')\n"
191
+ )
192
+
193
+ say "**************************************************************************"
194
+ say "**************************************************************************"
195
+ say ""
196
+ say "1. Recommended Heroku Addons: Mailtrap, Rollbar, Cloudinary"
197
+ say ""
198
+ say "2. Setup Git Hooks to auto-check code and cleanup staled branches:"
199
+ say "$ `git config core.hooksPath bin/git-hooks`"
200
+ say ""
201
+ say "3. Please, set CODECOV_TOKEN, GITHUB_TOKEN and PRONTO_GITHUB_ACCESS_TOKEN"
202
+ say "environment variables in CircleCI and your local env"
203
+ say ""
204
+ say " For code coverage report aggregator, running code static analysis"
205
+ say "and auto-update of the tools."
206
+ say ""
207
+ say "**************************************************************************"
208
+ say "**************************************************************************"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jt_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Keen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-22 00:00:00.000000000 Z
11
+ date: 2020-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -37,12 +37,14 @@ files:
37
37
  - ".github/ISSUE_TEMPLATE/custom.md"
38
38
  - ".github/ISSUE_TEMPLATE/feature_request.md"
39
39
  - ".gitignore"
40
+ - ".standard.yml"
40
41
  - Gemfile
41
42
  - LICENSE
42
43
  - LICENSE.txt
43
44
  - README.md
44
45
  - Rakefile
45
46
  - _config.yml
47
+ - bin/standardrb
46
48
  - bin/test
47
49
  - jt_tools.gemspec
48
50
  - lib/install/.better-html.yml
@@ -76,6 +78,7 @@ files:
76
78
  - lib/jt_tools/version.rb
77
79
  - lib/tasks/install.rake
78
80
  - rejuvenation.rb
81
+ - shipit.rubygems.yml
79
82
  - template.rb
80
83
  homepage: https://jtway.co
81
84
  licenses:
@@ -84,7 +87,7 @@ metadata:
84
87
  homepage_uri: https://jtway.co
85
88
  source_code_uri: https://github.com/jetthoughts/jt-tools/
86
89
  changelog_uri: https://github.com/jetthoughts/jt-tools/
87
- post_install_message:
90
+ post_install_message:
88
91
  rdoc_options: []
89
92
  require_paths:
90
93
  - lib
@@ -99,8 +102,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
102
  - !ruby/object:Gem::Version
100
103
  version: '0'
101
104
  requirements: []
102
- rubygems_version: 3.1.3
103
- signing_key:
105
+ rubygems_version: 3.1.4
106
+ signing_key:
104
107
  specification_version: 4
105
108
  summary: Setup development scripts to manage code base effectively
106
109
  test_files: []