jt_tools 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.better-html.yml +1 -0
- data/.erb-lint.yml +1 -0
- data/.gitignore +57 -0
- data/.pronto.yml +1 -0
- data/.pronto_eslint_npm.yml +1 -0
- data/.rubocop.yml +1 -0
- data/.yamllint +1 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/Rakefile +12 -0
- data/_sample/test_erb.html.erb +2 -0
- data/_sample/test_eslint.js +1 -0
- data/_sample/test_yamlint.yml +1 -0
- data/jt_tools.gemspec +31 -0
- data/lib/install/.better-html.yml +0 -0
- data/lib/install/.circleci/config.yml +111 -0
- data/lib/install/.erb-lint.yml +26 -0
- data/lib/install/.eslintrc.js +16 -0
- data/lib/install/.prettierrc +5 -0
- data/lib/install/.pronto.yml +28 -0
- data/lib/install/.pronto_eslint_npm.yml +2 -0
- data/lib/install/.rubocop.yml +104 -0
- data/lib/install/.yamllint +8 -0
- data/lib/install/Gemfile.tools +26 -0
- data/lib/install/Procfile +3 -0
- data/lib/install/app.json +75 -0
- data/lib/install/bin/heroku-postdeploy +10 -0
- data/lib/install/bin/heroku-release +1 -0
- data/lib/install/bin/lint-github-pr +14 -0
- data/lib/install/bin/tools-setup +4 -0
- data/lib/install/bin/tools-upgrade +3 -0
- data/lib/install/template.rb +38 -0
- data/lib/jt_tools/railtie.rb +7 -0
- data/lib/jt_tools.rb +1 -0
- data/lib/tasks/install.rake +9 -0
- data/lib/version.rb +5 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f6ba3ad94a3bee3b2a28743ed3a29484aa2bdca6f9eea16465559d7a09b5e4b0
|
4
|
+
data.tar.gz: 2ac38915548c69b18fc2df17612fc6d44e277d3beafe489ed8b6bc3cd3fb50b7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1d396a3237e97aeee07d24583ed8dd06acbb4ef924e9b2030ba4235f2b89254381715036978b38c3abe2d6d72cbbb82378df51422af491a825a32b2649c0a08a
|
7
|
+
data.tar.gz: 8c17719e1c87f8027acbd3a4653ef43254d5037fbed1d0dd83849246bd67ab6786ef12124618ea4f662c0a36d0d98598a78a9501b29aeeb9b87d485a53e4c4a0
|
data/.better-html.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
./lib/install/.better-html.yml
|
data/.erb-lint.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
./lib/install/.erb-lint.yml
|
data/.gitignore
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
*.rbc
|
2
|
+
*.lock
|
3
|
+
capybara-*.html
|
4
|
+
.rspec
|
5
|
+
/log
|
6
|
+
/tmp
|
7
|
+
/db/*.sqlite3
|
8
|
+
/db/*.sqlite3-journal
|
9
|
+
/public/system
|
10
|
+
/coverage/
|
11
|
+
/spec/tmp
|
12
|
+
*.orig
|
13
|
+
rerun.txt
|
14
|
+
pickle-email-*.html
|
15
|
+
|
16
|
+
# TODO Comment out this rule if you are OK with secrets being uploaded to the repo
|
17
|
+
config/initializers/secret_token.rb
|
18
|
+
config/master.key
|
19
|
+
|
20
|
+
# Only include if you have production secrets in this file, which is no longer a Rails default
|
21
|
+
# config/secrets.yml
|
22
|
+
|
23
|
+
# dotenv
|
24
|
+
# TODO Comment out this rule if environment variables can be committed
|
25
|
+
.env
|
26
|
+
|
27
|
+
## Environment normalization:
|
28
|
+
*/bin/bundle
|
29
|
+
.bundle
|
30
|
+
*/vendor/bundle
|
31
|
+
|
32
|
+
# these should all be checked in to normalize the environment:
|
33
|
+
# Gemfile.lock, .ruby-version, .ruby-gemset
|
34
|
+
|
35
|
+
Gemfile.tools.lock
|
36
|
+
|
37
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
38
|
+
.rvmrc
|
39
|
+
|
40
|
+
# if using bower-rails ignore default bower_components path bower.json files
|
41
|
+
/vendor/assets/bower_components
|
42
|
+
*.bowerrc
|
43
|
+
bower.json
|
44
|
+
|
45
|
+
# Ignore pow environment settings
|
46
|
+
.powenv
|
47
|
+
|
48
|
+
# Ignore Byebug command history file.
|
49
|
+
.byebug_history
|
50
|
+
|
51
|
+
# Ignore node_modules
|
52
|
+
node_modules/
|
53
|
+
|
54
|
+
.circleci/
|
55
|
+
lib/install/.bundle/
|
56
|
+
|
57
|
+
pkg
|
data/.pronto.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
./lib/install/.pronto.yml
|
@@ -0,0 +1 @@
|
|
1
|
+
./lib/install/.pronto_eslint_npm.yml
|
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
./lib/install/.rubocop.yml
|
data/.yamllint
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
./lib/install/.yamllint
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2019 JetThoughts
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Paul Keen
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# JT::Tools
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'jt_tools', groups: [:development]
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
$ bin/rails jt_tools:install
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
```bash
|
19
|
+
bin/pronto run
|
20
|
+
```
|
21
|
+
|
22
|
+
```bash
|
23
|
+
bin/rubocop
|
24
|
+
```
|
25
|
+
|
26
|
+
```bash
|
27
|
+
bin/tools-setup
|
28
|
+
```
|
29
|
+
|
30
|
+
```bash
|
31
|
+
bin/tools-upgrade
|
32
|
+
```
|
33
|
+
|
34
|
+
```bash
|
35
|
+
bin/lint-github-pr
|
36
|
+
```
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
const longesssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssst_var = 1;
|
@@ -0,0 +1 @@
|
|
1
|
+
asdf: asdf
|
data/jt_tools.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'jt_tools'
|
9
|
+
spec.version = JtTools::VERSION
|
10
|
+
spec.authors = ['Paul Keen']
|
11
|
+
spec.email = ['pftg@users.noreply.github.com']
|
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'
|
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/'
|
21
|
+
|
22
|
+
spec.add_dependency 'railties', '>= 4.2'
|
23
|
+
|
24
|
+
# Specify which files should be added to the gem when it is released.
|
25
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
27
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
|
+
end
|
29
|
+
|
30
|
+
spec.require_paths = ['lib']
|
31
|
+
end
|
File without changes
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
---
|
6
|
+
|
7
|
+
version: 2.1
|
8
|
+
|
9
|
+
workflows:
|
10
|
+
version: 2
|
11
|
+
test:
|
12
|
+
jobs:
|
13
|
+
- lint:
|
14
|
+
filters:
|
15
|
+
branches:
|
16
|
+
ignore:
|
17
|
+
- master
|
18
|
+
- production
|
19
|
+
- staging
|
20
|
+
|
21
|
+
jobs:
|
22
|
+
test:
|
23
|
+
docker:
|
24
|
+
# specify the version you desire here
|
25
|
+
- image: circleci/ruby:2.6.4-node-browsers
|
26
|
+
environment:
|
27
|
+
COVERAGE: true
|
28
|
+
BUNDLE_GEMFILE: Gemfile
|
29
|
+
BUNDLE_WITHOUT: "production:staging:development"
|
30
|
+
BUNDLE_JOBS: 3
|
31
|
+
BUNDLE_RETRY: 3
|
32
|
+
BUNDLE_PATH: vendor/bundle
|
33
|
+
RAILS_ENV: test
|
34
|
+
RACK_ENV: test
|
35
|
+
PGHOST: 127.0.0.1
|
36
|
+
PGUSER: ubuntu
|
37
|
+
DATABASE_URL: postgresql:ubuntu@127.0.0.1/db_test
|
38
|
+
|
39
|
+
# Specify service dependencies here if necessary
|
40
|
+
# CircleCI maintains a library of pre-built images
|
41
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
42
|
+
- image: circleci/postgres:alpine-ram
|
43
|
+
environment:
|
44
|
+
POSTGRES_USER: ubuntu
|
45
|
+
POSTGRES_DB: db_test
|
46
|
+
|
47
|
+
steps:
|
48
|
+
- checkout
|
49
|
+
|
50
|
+
# Download and cache dependencies
|
51
|
+
- restore_cache:
|
52
|
+
name: Restore Bundler Cache
|
53
|
+
keys:
|
54
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
55
|
+
- v1-dependencies-
|
56
|
+
|
57
|
+
- run:
|
58
|
+
name: Install Bundler Dependencies
|
59
|
+
command: bin/bundle check --path vendor/bundle || bin/bundle install --deployment
|
60
|
+
|
61
|
+
- save_cache:
|
62
|
+
name: Save Bundler Cache
|
63
|
+
paths:
|
64
|
+
- ./vendor/bundle
|
65
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
66
|
+
|
67
|
+
- run: bin/rails db:schema:load
|
68
|
+
- run: bin/rails test
|
69
|
+
|
70
|
+
# collect reports
|
71
|
+
- store_test_results:
|
72
|
+
path: ./test/reports/
|
73
|
+
- store_artifacts:
|
74
|
+
path: ./coverage
|
75
|
+
lint:
|
76
|
+
docker:
|
77
|
+
- image: circleci/ruby:2.6.4-stretch-node
|
78
|
+
environment:
|
79
|
+
DISABLE_SPRING: 1
|
80
|
+
BUNDLE_GEMFILE: Gemfile.tools
|
81
|
+
BUNDLE_JOBS: 3
|
82
|
+
BUNDLE_RETRY: 3
|
83
|
+
|
84
|
+
steps:
|
85
|
+
- checkout
|
86
|
+
|
87
|
+
- restore_cache:
|
88
|
+
keys:
|
89
|
+
- v1-tools-dependencies-{{ checksum "Gemfile.tools.lock" }}-{{ checksum "yarn.lock" }}
|
90
|
+
- v1-tools-dependencies-
|
91
|
+
|
92
|
+
- run:
|
93
|
+
name: Install cmake for building pronto dependencies
|
94
|
+
command: sudo apt-get install cmake yamllint python3-setuptools python3-pkg-resources
|
95
|
+
|
96
|
+
- run:
|
97
|
+
name: Install Bundle Dependencies
|
98
|
+
command: bin/bundle check --path vendor/bundle-tools || bin/bundle install --path vendor/bundle-tools
|
99
|
+
|
100
|
+
- run:
|
101
|
+
name: Install Node Packages
|
102
|
+
command: bin/yarn
|
103
|
+
|
104
|
+
- save_cache:
|
105
|
+
key: v1-tools-dependencies-{{ checksum "Gemfile.tools.lock" }}-{{ checksum "yarn.lock" }}
|
106
|
+
paths:
|
107
|
+
- ./vendor/bundle-tools
|
108
|
+
- ./node_modules
|
109
|
+
|
110
|
+
- run: bin/lint-github-pr
|
111
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
linters:
|
3
|
+
ErbSafety:
|
4
|
+
enabled: true
|
5
|
+
better_html_config: .better-html.yml
|
6
|
+
Rubocop:
|
7
|
+
enabled: true
|
8
|
+
rubocop_config:
|
9
|
+
inherit_from:
|
10
|
+
- .rubocop.yml
|
11
|
+
Layout/InitialIndentation:
|
12
|
+
Enabled: false
|
13
|
+
Layout/TrailingBlankLines:
|
14
|
+
Enabled: false
|
15
|
+
Layout/TrailingWhitespace:
|
16
|
+
Enabled: false
|
17
|
+
Naming/FileName:
|
18
|
+
Enabled: false
|
19
|
+
Style/FrozenStringLiteralComment:
|
20
|
+
Enabled: false
|
21
|
+
Metrics/LineLength:
|
22
|
+
Enabled: false
|
23
|
+
Lint/UselessAssignment:
|
24
|
+
Enabled: false
|
25
|
+
Rails/OutputSafety:
|
26
|
+
Enabled: false
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Documentation on http://eslint.org/docs/rules/
|
2
|
+
|
3
|
+
module.exports = {
|
4
|
+
"extends": ["airbnb-base", "prettier"],
|
5
|
+
"plugins": ["prettier"],
|
6
|
+
"env": {
|
7
|
+
"browser": true,
|
8
|
+
"node": true,
|
9
|
+
"jquery": true
|
10
|
+
},
|
11
|
+
"rules": {
|
12
|
+
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
|
13
|
+
"max-len": ["error", { "code": 113, "tabWidth": 2 }],
|
14
|
+
"prettier/prettier": ["error"]
|
15
|
+
},
|
16
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
all:
|
3
|
+
exclude:
|
4
|
+
- .*
|
5
|
+
- .**/*
|
6
|
+
- bin/*
|
7
|
+
- db/schema.rb
|
8
|
+
- db/migrate/**/*
|
9
|
+
- config/**/*
|
10
|
+
- docs/**/*
|
11
|
+
- node_modules/**/*
|
12
|
+
- public/**/*
|
13
|
+
- vendor/**/*
|
14
|
+
|
15
|
+
eslint:
|
16
|
+
exclude:
|
17
|
+
- vendor/assets/**/*
|
18
|
+
- vendor/packs/**/*
|
19
|
+
|
20
|
+
flay:
|
21
|
+
exclude:
|
22
|
+
- test/**/*
|
23
|
+
|
24
|
+
format: "%{runner} %{level} %{msg}"
|
25
|
+
|
26
|
+
max_warnings: 10
|
27
|
+
verbose: true
|
28
|
+
warnings_per_review: 5
|
@@ -0,0 +1,104 @@
|
|
1
|
+
---
|
2
|
+
require:
|
3
|
+
- rubocop-performance
|
4
|
+
- rubocop-rails
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
TargetRubyVersion: 2.6.4
|
8
|
+
Exclude:
|
9
|
+
- 'db/schema.rb'
|
10
|
+
- 'db/migrate/**/*'
|
11
|
+
|
12
|
+
Layout/AlignHash:
|
13
|
+
EnforcedHashRocketStyle: key
|
14
|
+
EnforcedColonStyle: key
|
15
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
16
|
+
|
17
|
+
Layout/AlignParameters:
|
18
|
+
EnforcedStyle: with_fixed_indentation
|
19
|
+
|
20
|
+
Layout/EmptyLinesAroundBlockBody:
|
21
|
+
Exclude:
|
22
|
+
- 'db/schema.rb'
|
23
|
+
|
24
|
+
Layout/MultilineOperationIndentation:
|
25
|
+
EnforcedStyle: indented
|
26
|
+
|
27
|
+
Layout/MultilineMethodCallIndentation:
|
28
|
+
EnforcedStyle: indented
|
29
|
+
|
30
|
+
Layout/MultilineMethodCallBraceLayout:
|
31
|
+
EnforcedStyle: symmetrical
|
32
|
+
|
33
|
+
Layout/SpaceInLambdaLiteral:
|
34
|
+
EnforcedStyle: require_space
|
35
|
+
|
36
|
+
Naming/PredicateName:
|
37
|
+
Exclude:
|
38
|
+
- 'app/helpers/application_helper.rb'
|
39
|
+
|
40
|
+
Metrics/AbcSize:
|
41
|
+
Exclude:
|
42
|
+
- test/**/*.rb
|
43
|
+
|
44
|
+
Metrics/LineLength:
|
45
|
+
Max: 113
|
46
|
+
|
47
|
+
Metrics/ClassLength:
|
48
|
+
CountComments: false
|
49
|
+
Exclude:
|
50
|
+
- 'test/**/*.rb'
|
51
|
+
|
52
|
+
Metrics/MethodLength:
|
53
|
+
CountComments: false
|
54
|
+
Exclude:
|
55
|
+
- 'test/**/*.rb'
|
56
|
+
|
57
|
+
Metrics/ModuleLength:
|
58
|
+
CountComments: false
|
59
|
+
Exclude:
|
60
|
+
- 'test/**/*.rb'
|
61
|
+
|
62
|
+
Naming/MemoizedInstanceVariableName:
|
63
|
+
EnforcedStyleForLeadingUnderscores: required
|
64
|
+
|
65
|
+
Style/ClassAndModuleChildren:
|
66
|
+
Exclude:
|
67
|
+
- 'test/**/*.rb'
|
68
|
+
|
69
|
+
Style/Documentation:
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
Style/FrozenStringLiteralComment:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
Style/SafeNavigation:
|
76
|
+
Enabled: false
|
77
|
+
|
78
|
+
Style/StabbyLambdaParentheses:
|
79
|
+
EnforcedStyle: require_no_parentheses
|
80
|
+
|
81
|
+
Style/StringLiterals:
|
82
|
+
Exclude:
|
83
|
+
- 'db/schema.rb'
|
84
|
+
|
85
|
+
Style/TrailingCommaInHashLiteral:
|
86
|
+
EnforcedStyleForMultiline: consistent_comma
|
87
|
+
|
88
|
+
# Rails
|
89
|
+
|
90
|
+
Rails:
|
91
|
+
Enabled: true
|
92
|
+
|
93
|
+
Rails/HasAndBelongsToMany:
|
94
|
+
Enabled: false
|
95
|
+
|
96
|
+
Rails/SkipsModelValidations:
|
97
|
+
Blacklist: []
|
98
|
+
|
99
|
+
Rails/UnknownEnv:
|
100
|
+
Environments:
|
101
|
+
- development
|
102
|
+
- production
|
103
|
+
- staging
|
104
|
+
- test
|
@@ -0,0 +1,26 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
git_source(:github) do |repo_name|
|
4
|
+
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
|
5
|
+
"https://github.com/#{repo_name}.git"
|
6
|
+
end
|
7
|
+
|
8
|
+
gem 'hub', require: false
|
9
|
+
gem 'oj', require: false
|
10
|
+
|
11
|
+
group :tools do
|
12
|
+
gem 'pronto'
|
13
|
+
gem 'pronto-blacklist', require: false
|
14
|
+
gem 'pronto-erb_lint', require: false
|
15
|
+
gem 'pronto-eslint_npm', require: false
|
16
|
+
gem 'pronto-fasterer', require: false
|
17
|
+
gem 'pronto-rails_best_practices', require: false
|
18
|
+
gem 'pronto-reek', require: false
|
19
|
+
gem 'pronto-rubocop', require: false
|
20
|
+
gem 'pronto-yamllint', require: false
|
21
|
+
|
22
|
+
gem 'rubocop-rails', require: false
|
23
|
+
gem 'rubocop-performance', require: false
|
24
|
+
|
25
|
+
gem 'rugged', '0.28.2'
|
26
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
{
|
2
|
+
"name": "APP NAME",
|
3
|
+
"scripts": {
|
4
|
+
"postdeploy": "bin/heroku-postdeploy"
|
5
|
+
},
|
6
|
+
"env": {
|
7
|
+
"HEROKU_APP_NAME": {
|
8
|
+
"required": true
|
9
|
+
},
|
10
|
+
"HEROKU_PARENT_APP_NAME": {
|
11
|
+
"required": true
|
12
|
+
},
|
13
|
+
"DB_SEED_ON_DEPLOY": "true",
|
14
|
+
"BUNDLE_WITHOUT": "development:test:production",
|
15
|
+
"MAILTRAP_ADDRESS": {
|
16
|
+
"required": true
|
17
|
+
},
|
18
|
+
"MAILTRAP_API_TOKEN": {
|
19
|
+
"required": true
|
20
|
+
},
|
21
|
+
"MAILTRAP_CATCH_MAIL": {
|
22
|
+
"required": true
|
23
|
+
},
|
24
|
+
"MAILTRAP_DOMAIN": {
|
25
|
+
"required": true
|
26
|
+
},
|
27
|
+
"MAILTRAP_PASSWORD": {
|
28
|
+
"required": true
|
29
|
+
},
|
30
|
+
"MAILTRAP_PORT": {
|
31
|
+
"required": true
|
32
|
+
},
|
33
|
+
"MAILTRAP_USER_NAME": {
|
34
|
+
"required": true
|
35
|
+
},
|
36
|
+
"RACK_ENV": {
|
37
|
+
"required": true
|
38
|
+
},
|
39
|
+
"RAILS_ENV": {
|
40
|
+
"required": true
|
41
|
+
},
|
42
|
+
"RAILS_LOG_TO_STDOUT": "enabled",
|
43
|
+
"RAILS_MASTER_KEY": {
|
44
|
+
"required": true
|
45
|
+
},
|
46
|
+
"RAILS_SERVE_STATIC_FILES": "enabled",
|
47
|
+
"REDIS_PROVIDER": "REDISTOGO_URL",
|
48
|
+
"SECRET_KEY_BASE": {
|
49
|
+
"generator": "secret"
|
50
|
+
},
|
51
|
+
"ROLLBAR_ACCESS_TOKEN": {
|
52
|
+
"required": true
|
53
|
+
},
|
54
|
+
"ROLLBAR_ENDPOINT": {
|
55
|
+
"required": true
|
56
|
+
},
|
57
|
+
"ROLLBAR_ENV": "development",
|
58
|
+
},
|
59
|
+
"addons": [
|
60
|
+
"mailtrap:unpaid",
|
61
|
+
"memcachier:dev",
|
62
|
+
"papertrail:choklad",
|
63
|
+
"heroku-postgresql:hobby-dev",
|
64
|
+
"redistogo:nano"
|
65
|
+
],
|
66
|
+
"buildpacks": [
|
67
|
+
{
|
68
|
+
"url": "https://github.com/heroku/heroku-buildpack-activestorage-preview"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"url": "heroku/ruby"
|
72
|
+
}
|
73
|
+
],
|
74
|
+
"stack": "heroku-18"
|
75
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
bin/rake db:migrate
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -eo pipefail
|
4
|
+
|
5
|
+
reporters_opt=""
|
6
|
+
|
7
|
+
if [[ "$CIRCLECI" == "true" ]]
|
8
|
+
then
|
9
|
+
git fetch origin master
|
10
|
+
reporters_opt="-f github_status github_pr_review -c origin/master --exit-code"
|
11
|
+
fi
|
12
|
+
|
13
|
+
BUNDLE_GEMFILE=Gemfile.tools bundle exec pronto run -c origin/master $reporters_opt --exit-code $@
|
14
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
say 'Copying binstubs'
|
4
|
+
directory "#{__dir__}/bin", 'bin'
|
5
|
+
|
6
|
+
chmod 'bin', 0o755 & ~File.umask, verbose: false
|
7
|
+
|
8
|
+
say 'Setup default bundle parallel jobs to 4'
|
9
|
+
run 'bundle config jobs 4'
|
10
|
+
|
11
|
+
say 'Copying tools gemfile'
|
12
|
+
copy_file "#{__dir__}/Gemfile.tools", 'Gemfile.tools'
|
13
|
+
|
14
|
+
run 'yarn add -D eslint eslint-config-airbnb-base \
|
15
|
+
eslint-config-prettier eslint-plugin-import eslint-plugin-prettier prettier'
|
16
|
+
|
17
|
+
run 'bin/tools-setup'
|
18
|
+
|
19
|
+
run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub pronto'
|
20
|
+
run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub rubocop'
|
21
|
+
|
22
|
+
say 'Copying lint configurations'
|
23
|
+
|
24
|
+
copy_file "#{__dir__}/.better-html.yml", '.better-html.yml'
|
25
|
+
copy_file "#{__dir__}/.erb-lint.yml", '.erb-lint.yml'
|
26
|
+
copy_file "#{__dir__}/.eslintrc.js", '.eslintrc.js'
|
27
|
+
copy_file "#{__dir__}/.prettierrc", '.prettierrc'
|
28
|
+
copy_file "#{__dir__}/.pronto.yml", '.pronto.yml'
|
29
|
+
copy_file "#{__dir__}/.pronto_eslint_npm.yml", '.pronto_eslint_npm.yml'
|
30
|
+
copy_file "#{__dir__}/.rubocop.yml", '.rubocop.yml'
|
31
|
+
copy_file "#{__dir__}/.yamllint", '.yamllint'
|
32
|
+
|
33
|
+
say 'Copying circleci configuration'
|
34
|
+
directory "#{__dir__}/.circleci", '.circleci'
|
35
|
+
|
36
|
+
say 'Copying heroku configuration'
|
37
|
+
copy_file "#{__dir__}/app.json", 'app.json'
|
38
|
+
copy_file "#{__dir__}/Procfile", 'Procfile'
|
data/lib/jt_tools.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'jt_tools/railtie' if defined?(Rails)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
install_template_path = File.expand_path('../install/template.rb', __dir__).freeze
|
2
|
+
bin_path = ENV['BUNDLE_BIN'] || './bin'
|
3
|
+
|
4
|
+
namespace :jt_tools do
|
5
|
+
desc 'Install jt-tools in this application'
|
6
|
+
task :install do
|
7
|
+
exec "#{RbConfig.ruby} #{bin_path}/rails app:template LOCATION=#{install_template_path}"
|
8
|
+
end
|
9
|
+
end
|
data/lib/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jt_tools
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Paul Keen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-09-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.2'
|
27
|
+
description: Helpful scripts to run linters locally and on CI
|
28
|
+
email:
|
29
|
+
- pftg@users.noreply.github.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".better-html.yml"
|
35
|
+
- ".erb-lint.yml"
|
36
|
+
- ".gitignore"
|
37
|
+
- ".pronto.yml"
|
38
|
+
- ".pronto_eslint_npm.yml"
|
39
|
+
- ".rubocop.yml"
|
40
|
+
- ".yamllint"
|
41
|
+
- Gemfile
|
42
|
+
- LICENSE
|
43
|
+
- LICENSE.txt
|
44
|
+
- README.md
|
45
|
+
- Rakefile
|
46
|
+
- _sample/test_erb.html.erb
|
47
|
+
- _sample/test_eslint.js
|
48
|
+
- _sample/test_yamlint.yml
|
49
|
+
- jt_tools.gemspec
|
50
|
+
- lib/install/.better-html.yml
|
51
|
+
- lib/install/.circleci/config.yml
|
52
|
+
- lib/install/.erb-lint.yml
|
53
|
+
- lib/install/.eslintrc.js
|
54
|
+
- lib/install/.prettierrc
|
55
|
+
- lib/install/.pronto.yml
|
56
|
+
- lib/install/.pronto_eslint_npm.yml
|
57
|
+
- lib/install/.rubocop.yml
|
58
|
+
- lib/install/.yamllint
|
59
|
+
- lib/install/Gemfile.tools
|
60
|
+
- lib/install/Procfile
|
61
|
+
- lib/install/app.json
|
62
|
+
- lib/install/bin/heroku-postdeploy
|
63
|
+
- lib/install/bin/heroku-release
|
64
|
+
- lib/install/bin/lint-github-pr
|
65
|
+
- lib/install/bin/tools-setup
|
66
|
+
- lib/install/bin/tools-upgrade
|
67
|
+
- lib/install/template.rb
|
68
|
+
- lib/jt_tools.rb
|
69
|
+
- lib/jt_tools/railtie.rb
|
70
|
+
- lib/tasks/install.rake
|
71
|
+
- lib/version.rb
|
72
|
+
homepage: https://jtway.co
|
73
|
+
licenses:
|
74
|
+
- MIT
|
75
|
+
metadata:
|
76
|
+
homepage_uri: https://jtway.co
|
77
|
+
source_code_uri: https://github.com/jetthoughts/jt-tools/
|
78
|
+
changelog_uri: https://github.com/jetthoughts/jt-tools/
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubygems_version: 3.0.6
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Setup development scripts to manage code base effectively
|
98
|
+
test_files: []
|