boxt_ruby_style_guide 2.0.0
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 +7 -0
- data/.circleci/config.yml +29 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +21 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +97 -0
- data/LICENSE.txt +21 -0
- data/README.md +106 -0
- data/Rakefile +14 -0
- data/VERSION +1 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/boxt_ruby_style_guide.gemspec +39 -0
- data/config.reek +6 -0
- data/default.yml +37 -0
- data/lib/boxt_ruby_style_guide.rb +24 -0
- data/lib/boxt_ruby_style_guide/railtie.rb +12 -0
- data/lib/boxt_ruby_style_guide/version.rb +5 -0
- data/tasks/lint.rake +24 -0
- metadata +222 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 3cf99c87343e8450a4aa86d90493ca202b1d3cfcbdea1fcb805e0023efd63c32
|
|
4
|
+
data.tar.gz: 9ae4a2d50c330e0286f5b168a03cd1ef89facdd0a4cddc34ba35f4309e659c02
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 87834c401242cbda4dead8687defcf286e2dbe000da0727ebff7f01c47d2f0798d3785265f18d42c612013ca830270a26692fc4bd0bd925d16742acef7c6e56d
|
|
7
|
+
data.tar.gz: fc056da1890c4381a1dc9519288cec772401955ec9794f695389549624713be59202bcd235f68cd74642a0b95fb7308a7121307f574acfdc359cf04262a34586
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
jobs:
|
|
3
|
+
build:
|
|
4
|
+
parallelism: 3
|
|
5
|
+
docker:
|
|
6
|
+
- image: circleci/ruby:2.5.3
|
|
7
|
+
environment:
|
|
8
|
+
BUNDLE_JOBS: 3
|
|
9
|
+
BUNDLE_RETRY: 3
|
|
10
|
+
BUNDLE_PATH: vendor/bundle
|
|
11
|
+
steps:
|
|
12
|
+
- checkout
|
|
13
|
+
- run:
|
|
14
|
+
name: Which bundler?
|
|
15
|
+
command: bundle -v
|
|
16
|
+
- restore_cache:
|
|
17
|
+
keys: boxt-ruby-style-guide-{{ checksum "Gemfile.lock" }}
|
|
18
|
+
- run:
|
|
19
|
+
name: Bundle Install
|
|
20
|
+
command: bundle check || bundle install
|
|
21
|
+
- save_cache:
|
|
22
|
+
key: boxt-ruby-style-guide-{{ checksum "Gemfile.lock" }}
|
|
23
|
+
paths:
|
|
24
|
+
- vendor/bundle
|
|
25
|
+
- run:
|
|
26
|
+
name: Run tests
|
|
27
|
+
command: bundle exec rake test | circleci tests split --split-by=timings)
|
|
28
|
+
- store_test_results:
|
|
29
|
+
path: test_results
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
inherit_from: default.yml
|
data/.ruby-gemset
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
boxt-ruby-style-guide
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-2.5.3
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
language: ruby
|
|
2
|
+
sudo: false
|
|
3
|
+
matrix:
|
|
4
|
+
fast_finish: true
|
|
5
|
+
branches:
|
|
6
|
+
only:
|
|
7
|
+
- develop
|
|
8
|
+
- master
|
|
9
|
+
- /\Arelease.*\z/
|
|
10
|
+
- /\Ahotfix.*\z/
|
|
11
|
+
before_script:
|
|
12
|
+
- gem install bundler
|
|
13
|
+
- git config --local user.email "developers@boxt.co.uk"
|
|
14
|
+
- git config --local user.name "Boxt Developers Group"
|
|
15
|
+
script:
|
|
16
|
+
- bundle exec rake test
|
|
17
|
+
cache: bundler
|
|
18
|
+
notifications:
|
|
19
|
+
email:
|
|
20
|
+
- developers@boxt.co.uk
|
|
21
|
+
slack: boxt:hwim3Ix4PeXQtkTXRZ5kd8Kr
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
boxt_ruby_style_guide (2.0.0)
|
|
5
|
+
reek (~> 5.3, >= 5.3.0)
|
|
6
|
+
rubocop (~> 0.63.1)
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
ansi (1.5.0)
|
|
12
|
+
ast (2.4.0)
|
|
13
|
+
axiom-types (0.1.1)
|
|
14
|
+
descendants_tracker (~> 0.0.4)
|
|
15
|
+
ice_nine (~> 0.11.0)
|
|
16
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
|
17
|
+
builder (3.2.3)
|
|
18
|
+
codeclimate-engine-rb (0.4.1)
|
|
19
|
+
virtus (~> 1.0)
|
|
20
|
+
coercible (1.0.0)
|
|
21
|
+
descendants_tracker (~> 0.0.1)
|
|
22
|
+
descendants_tracker (0.0.4)
|
|
23
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
|
24
|
+
docile (1.3.1)
|
|
25
|
+
equalizer (0.0.11)
|
|
26
|
+
ice_nine (0.11.2)
|
|
27
|
+
jaro_winkler (1.5.2)
|
|
28
|
+
json (2.1.0)
|
|
29
|
+
kwalify (0.7.2)
|
|
30
|
+
minitest (5.11.3)
|
|
31
|
+
minitest-fail-fast (0.1.0)
|
|
32
|
+
minitest (~> 5)
|
|
33
|
+
minitest-macos-notification (0.0.5)
|
|
34
|
+
minitest (~> 5.0)
|
|
35
|
+
minitest-reporters (~> 1.3)
|
|
36
|
+
os (~> 1.0)
|
|
37
|
+
terminal-notifier (~> 2.0)
|
|
38
|
+
minitest-reporters (1.3.6)
|
|
39
|
+
ansi
|
|
40
|
+
builder
|
|
41
|
+
minitest (>= 5.0)
|
|
42
|
+
ruby-progressbar
|
|
43
|
+
os (1.0.0)
|
|
44
|
+
parallel (1.13.0)
|
|
45
|
+
parser (2.6.0.0)
|
|
46
|
+
ast (~> 2.4.0)
|
|
47
|
+
powerpack (0.1.2)
|
|
48
|
+
psych (3.1.0)
|
|
49
|
+
rainbow (3.0.0)
|
|
50
|
+
rake (12.3.2)
|
|
51
|
+
reek (5.3.1)
|
|
52
|
+
codeclimate-engine-rb (~> 0.4.0)
|
|
53
|
+
kwalify (~> 0.7.0)
|
|
54
|
+
parser (>= 2.5.0.0, < 2.7, != 2.5.1.1)
|
|
55
|
+
psych (~> 3.1.0)
|
|
56
|
+
rainbow (>= 2.0, < 4.0)
|
|
57
|
+
rubocop (0.63.1)
|
|
58
|
+
jaro_winkler (~> 1.5.1)
|
|
59
|
+
parallel (~> 1.10)
|
|
60
|
+
parser (>= 2.5, != 2.5.1.1)
|
|
61
|
+
powerpack (~> 0.1)
|
|
62
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
63
|
+
ruby-progressbar (~> 1.7)
|
|
64
|
+
unicode-display_width (~> 1.4.0)
|
|
65
|
+
ruby-progressbar (1.10.0)
|
|
66
|
+
simplecov (0.16.1)
|
|
67
|
+
docile (~> 1.1)
|
|
68
|
+
json (>= 1.8, < 3)
|
|
69
|
+
simplecov-html (~> 0.10.0)
|
|
70
|
+
simplecov-html (0.10.2)
|
|
71
|
+
terminal-notifier (2.0.0)
|
|
72
|
+
thread_safe (0.3.6)
|
|
73
|
+
unicode-display_width (1.4.1)
|
|
74
|
+
virtus (1.0.5)
|
|
75
|
+
axiom-types (~> 0.1)
|
|
76
|
+
coercible (~> 1.0)
|
|
77
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
|
78
|
+
equalizer (~> 0.0, >= 0.0.9)
|
|
79
|
+
|
|
80
|
+
PLATFORMS
|
|
81
|
+
ruby
|
|
82
|
+
|
|
83
|
+
DEPENDENCIES
|
|
84
|
+
boxt_ruby_style_guide!
|
|
85
|
+
bundler (~> 1.17, >= 1.17.3)
|
|
86
|
+
minitest (~> 5.11, >= 5.11.3)
|
|
87
|
+
minitest-fail-fast (~> 0.1.0)
|
|
88
|
+
minitest-macos-notification (~> 0.0.5)
|
|
89
|
+
minitest-reporters (~> 1.3, >= 1.3.6)
|
|
90
|
+
rake (~> 12.3, >= 12.3.2)
|
|
91
|
+
simplecov (~> 0.16.1)
|
|
92
|
+
|
|
93
|
+
RUBY VERSION
|
|
94
|
+
ruby 2.5.3p105
|
|
95
|
+
|
|
96
|
+
BUNDLED WITH
|
|
97
|
+
1.17.3
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Stuart Chinery
|
|
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,106 @@
|
|
|
1
|
+
# BOXT Ruby Style Guide
|
|
2
|
+
|
|
3
|
+
Ruby style guide info for the BOXT projects, as well as config settings for Rubocop.
|
|
4
|
+
|
|
5
|
+
For the most part we are using [this Ruby style guide](https://github.com/bbatsov/ruby-style-guide) as our base guide, with any deviations can be found in the `default.yml` for this project.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
We are now using Gemfury to host all our private packages. Please ensure you have added your private repo URL from Gemfury to the application's Gemfile, example:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
source 'https://qVz5xDENYkkuVWQ37cb5@gem.fury.io/boxt/'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Then add this line to your application's Gemfile:
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
group :development, :test do
|
|
19
|
+
# ...
|
|
20
|
+
gem "boxt_ruby_style_guide"
|
|
21
|
+
end
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
And then execute:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
bundle
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
To make the lint rake tasks available to non Rails apps and gems, add the following to the project's `Rakefile`:
|
|
31
|
+
|
|
32
|
+
```ruby
|
|
33
|
+
require "boxt_ruby_style_guide"
|
|
34
|
+
BoxtRubyStyleGuide.install_tasks
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Rails apps should have access to the lint tasks by default.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Reek Config
|
|
42
|
+
|
|
43
|
+
The Reek config is loaded automatically by this gem so there shouldn't be anything that you need to do. However am not sure if this will effect using in-editor linters.
|
|
44
|
+
|
|
45
|
+
### Rubocop Config
|
|
46
|
+
|
|
47
|
+
Add a `.rubocop.yml` file to the root of your project with the following settings:
|
|
48
|
+
|
|
49
|
+
```yml
|
|
50
|
+
inherit_gem:
|
|
51
|
+
boxt-ruby-style-guide:
|
|
52
|
+
- default.yml
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Lint Rake Tasks
|
|
56
|
+
|
|
57
|
+
There are a couple of rake tasks added to the project that allow you to run `reek` and `rubocop` against files listed as changed by Git.
|
|
58
|
+
|
|
59
|
+
To run `reek` against any changed files use:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
rake lint:reek
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
To run `rubocop` against any changed files use:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
rake lint:rubocop
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
If there are no changed files the commands will run against all files.
|
|
72
|
+
|
|
73
|
+
There are also some useful editor plugins to help with in-editor linting.
|
|
74
|
+
|
|
75
|
+
Atom:
|
|
76
|
+
|
|
77
|
+
* [linter-reek](https://atom.io/packages/linter-reek)
|
|
78
|
+
* [linter-rubocop](https://atom.io/packages/linter-rubocop)
|
|
79
|
+
* [rubocop-auto-correct](https://atom.io/packages/rubocop-auto-correct)
|
|
80
|
+
|
|
81
|
+
RubyMine:
|
|
82
|
+
|
|
83
|
+
* reek - Doesn't appear to be editor integration
|
|
84
|
+
* [rubocop](https://www.jetbrains.com/help/ruby/rubocop.html)
|
|
85
|
+
|
|
86
|
+
## Versioning
|
|
87
|
+
|
|
88
|
+
The version of the engine should be set in the `VERSION` file found in the root of the project. This is then read by the `lib/boxt/ruby/style/guide/core/version.rb` file to set in the engine.
|
|
89
|
+
|
|
90
|
+
If you are using [Git Flow AVH](https://github.com/petervanderdoes/gitflow-avh) and the default [Git Flow Hooks](https://github.com/jaspernbrouwer/git-flow-hooks) then the `VERSION` file will be updated automatically when creating a 'release' or 'hotfix' tag.
|
|
91
|
+
|
|
92
|
+
## Publishing to Gemfury
|
|
93
|
+
|
|
94
|
+
After setting the new version as explained above you will now need to push the new version to Gemfury. To do this carry out the following steps:
|
|
95
|
+
|
|
96
|
+
Add the Gemfury remote (you only need to do this once):
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
git remote add fury https://YOUR_USRNAME_HERE@git.fury.io/boxt/boxt_ruby_style_guide.git
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
And then push the new code to Gemfury:
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
git push fury master
|
|
106
|
+
```
|
data/Rakefile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/gem_tasks"
|
|
4
|
+
require "rake/testtask"
|
|
5
|
+
|
|
6
|
+
import "./tasks/lint.rake"
|
|
7
|
+
|
|
8
|
+
Rake::TestTask.new(:test) do |t|
|
|
9
|
+
t.libs << "test"
|
|
10
|
+
t.libs << "lib"
|
|
11
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
task default: :test
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.0
|
data/bin/console
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require "bundler/setup"
|
|
5
|
+
require "boxt/ruby/style/guide"
|
|
6
|
+
|
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
+
|
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
+
# require "pry"
|
|
12
|
+
# Pry.start
|
|
13
|
+
|
|
14
|
+
require "irb"
|
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# rubocop:disable Style/ExpandPathArguments
|
|
4
|
+
# NOTE: This is because of Gemfury failing with __dir__
|
|
5
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
6
|
+
# rubocop:enable Style/ExpandPathArguments
|
|
7
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
8
|
+
require "boxt_ruby_style_guide/version"
|
|
9
|
+
Gem::Specification.new do |spec|
|
|
10
|
+
spec.authors = ["Stuart Chinery"]
|
|
11
|
+
spec.description = "Ruby styleguide info for the BOXT projects, as well as"\
|
|
12
|
+
"config settings for Rubocop"
|
|
13
|
+
spec.email = ["stuart.chinery@gmail.com"]
|
|
14
|
+
spec.homepage = "https://github.com/boxt/ruby-style-guide"
|
|
15
|
+
spec.license = "MIT"
|
|
16
|
+
spec.name = "boxt_ruby_style_guide"
|
|
17
|
+
spec.summary = "Ruby styleguide info for the BOXT Ruby projects"
|
|
18
|
+
spec.version = BoxtRubyStyleGuide::VERSION
|
|
19
|
+
|
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
21
|
+
f.match(%r{^(test|spec|features)/})
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
spec.bindir = "exe"
|
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
26
|
+
spec.require_paths = ["lib"]
|
|
27
|
+
|
|
28
|
+
spec.add_dependency "reek", "~> 5.3", ">= 5.3.0"
|
|
29
|
+
spec.add_dependency "rubocop", "~> 0.63.1"
|
|
30
|
+
|
|
31
|
+
spec.add_development_dependency "bundler", "~> 1.17", ">= 1.17.3"
|
|
32
|
+
spec.add_development_dependency "minitest", "~> 5.11", ">= 5.11.3"
|
|
33
|
+
spec.add_development_dependency "minitest-fail-fast", "~> 0.1.0"
|
|
34
|
+
spec.add_development_dependency "minitest-macos-notification", "~> 0.0.5"
|
|
35
|
+
spec.add_development_dependency "minitest-reporters", "~> 1.3", ">= 1.3.6"
|
|
36
|
+
spec.add_development_dependency "rake", "~> 12.3", ">= 12.3.2"
|
|
37
|
+
spec.add_development_dependency "simplecov", "~> 0.16.1"
|
|
38
|
+
end
|
|
39
|
+
# rubocop:enable Metrics/BlockLength
|
data/config.reek
ADDED
data/default.yml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
TargetRubyVersion: 2.5.3
|
|
3
|
+
Exclude:
|
|
4
|
+
- "db/*"
|
|
5
|
+
- "db/**/*"
|
|
6
|
+
- "db/fixtures/**/*"
|
|
7
|
+
- "node_modules/**/*"
|
|
8
|
+
- "tmp/**/*"
|
|
9
|
+
- "vendor/**/*"
|
|
10
|
+
|
|
11
|
+
# To make Lorenzo happy
|
|
12
|
+
Layout/AlignHash:
|
|
13
|
+
EnforcedColonStyle: table
|
|
14
|
+
EnforcedHashRocketStyle: table
|
|
15
|
+
|
|
16
|
+
# Increase line length to 120
|
|
17
|
+
Metrics/LineLength:
|
|
18
|
+
Max: 120
|
|
19
|
+
|
|
20
|
+
# Exclude class and method length for test
|
|
21
|
+
Metrics/BlockLength:
|
|
22
|
+
Exclude:
|
|
23
|
+
- "test/**/*"
|
|
24
|
+
Metrics/ClassLength:
|
|
25
|
+
Exclude:
|
|
26
|
+
- "test/**/*"
|
|
27
|
+
Metrics/MethodLength:
|
|
28
|
+
Exclude:
|
|
29
|
+
- "test/**/*"
|
|
30
|
+
|
|
31
|
+
# Disable Style/Documentation because...
|
|
32
|
+
Style/Documentation:
|
|
33
|
+
Enabled: false
|
|
34
|
+
|
|
35
|
+
# Use double quotes ALL THE TIME!!!
|
|
36
|
+
Style/StringLiterals:
|
|
37
|
+
EnforcedStyle: double_quotes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "boxt_ruby_style_guide/railtie" if defined?(Rails)
|
|
4
|
+
require "boxt_ruby_style_guide/version"
|
|
5
|
+
|
|
6
|
+
module BoxtRubyStyleGuide
|
|
7
|
+
class << self
|
|
8
|
+
def install_tasks
|
|
9
|
+
Dir[File.join(gem_spec.gem_dir, "tasks/*.rake")].each do |file|
|
|
10
|
+
load(file)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def reek_config
|
|
15
|
+
File.join(gem_spec.gem_dir, "config.reek")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
def gem_spec
|
|
21
|
+
Gem::Specification.find_by_name("boxt_ruby_style_guide")
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
data/tasks/lint.rake
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "boxt_ruby_style_guide"
|
|
4
|
+
require "reek"
|
|
5
|
+
require "rubocop"
|
|
6
|
+
|
|
7
|
+
namespace :lint do
|
|
8
|
+
desc "Runs reek against all .rb files git lists as changed. Will run
|
|
9
|
+
against all files if none changed"
|
|
10
|
+
task :reek do
|
|
11
|
+
run_cmd("reek -c #{BoxtRubyStyleGuide.reek_config}")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
desc "Runs rubocop against all .rb files git lists as changed. Will run
|
|
15
|
+
against all files if none changed"
|
|
16
|
+
task :rubocop do
|
|
17
|
+
run_cmd("rubocop")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def run_cmd(cmd)
|
|
22
|
+
xargs = "xargs #{cmd}"
|
|
23
|
+
exec("git ls-files -m | xargs ls -1 2>/dev/null | grep '\.rb$' | #{xargs}")
|
|
24
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: boxt_ruby_style_guide
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Stuart Chinery
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-03-28 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: reek
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '5.3'
|
|
20
|
+
- - ">="
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 5.3.0
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - "~>"
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '5.3'
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 5.3.0
|
|
33
|
+
- !ruby/object:Gem::Dependency
|
|
34
|
+
name: rubocop
|
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: 0.63.1
|
|
40
|
+
type: :runtime
|
|
41
|
+
prerelease: false
|
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 0.63.1
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: bundler
|
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '1.17'
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: 1.17.3
|
|
57
|
+
type: :development
|
|
58
|
+
prerelease: false
|
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
60
|
+
requirements:
|
|
61
|
+
- - "~>"
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: '1.17'
|
|
64
|
+
- - ">="
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: 1.17.3
|
|
67
|
+
- !ruby/object:Gem::Dependency
|
|
68
|
+
name: minitest
|
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - "~>"
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '5.11'
|
|
74
|
+
- - ">="
|
|
75
|
+
- !ruby/object:Gem::Version
|
|
76
|
+
version: 5.11.3
|
|
77
|
+
type: :development
|
|
78
|
+
prerelease: false
|
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
80
|
+
requirements:
|
|
81
|
+
- - "~>"
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: '5.11'
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: 5.11.3
|
|
87
|
+
- !ruby/object:Gem::Dependency
|
|
88
|
+
name: minitest-fail-fast
|
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
|
90
|
+
requirements:
|
|
91
|
+
- - "~>"
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: 0.1.0
|
|
94
|
+
type: :development
|
|
95
|
+
prerelease: false
|
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
97
|
+
requirements:
|
|
98
|
+
- - "~>"
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: 0.1.0
|
|
101
|
+
- !ruby/object:Gem::Dependency
|
|
102
|
+
name: minitest-macos-notification
|
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
|
104
|
+
requirements:
|
|
105
|
+
- - "~>"
|
|
106
|
+
- !ruby/object:Gem::Version
|
|
107
|
+
version: 0.0.5
|
|
108
|
+
type: :development
|
|
109
|
+
prerelease: false
|
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
111
|
+
requirements:
|
|
112
|
+
- - "~>"
|
|
113
|
+
- !ruby/object:Gem::Version
|
|
114
|
+
version: 0.0.5
|
|
115
|
+
- !ruby/object:Gem::Dependency
|
|
116
|
+
name: minitest-reporters
|
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
|
118
|
+
requirements:
|
|
119
|
+
- - "~>"
|
|
120
|
+
- !ruby/object:Gem::Version
|
|
121
|
+
version: '1.3'
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: 1.3.6
|
|
125
|
+
type: :development
|
|
126
|
+
prerelease: false
|
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '1.3'
|
|
132
|
+
- - ">="
|
|
133
|
+
- !ruby/object:Gem::Version
|
|
134
|
+
version: 1.3.6
|
|
135
|
+
- !ruby/object:Gem::Dependency
|
|
136
|
+
name: rake
|
|
137
|
+
requirement: !ruby/object:Gem::Requirement
|
|
138
|
+
requirements:
|
|
139
|
+
- - "~>"
|
|
140
|
+
- !ruby/object:Gem::Version
|
|
141
|
+
version: '12.3'
|
|
142
|
+
- - ">="
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: 12.3.2
|
|
145
|
+
type: :development
|
|
146
|
+
prerelease: false
|
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - "~>"
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: '12.3'
|
|
152
|
+
- - ">="
|
|
153
|
+
- !ruby/object:Gem::Version
|
|
154
|
+
version: 12.3.2
|
|
155
|
+
- !ruby/object:Gem::Dependency
|
|
156
|
+
name: simplecov
|
|
157
|
+
requirement: !ruby/object:Gem::Requirement
|
|
158
|
+
requirements:
|
|
159
|
+
- - "~>"
|
|
160
|
+
- !ruby/object:Gem::Version
|
|
161
|
+
version: 0.16.1
|
|
162
|
+
type: :development
|
|
163
|
+
prerelease: false
|
|
164
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
165
|
+
requirements:
|
|
166
|
+
- - "~>"
|
|
167
|
+
- !ruby/object:Gem::Version
|
|
168
|
+
version: 0.16.1
|
|
169
|
+
description: Ruby styleguide info for the BOXT projects, as well asconfig settings
|
|
170
|
+
for Rubocop
|
|
171
|
+
email:
|
|
172
|
+
- stuart.chinery@gmail.com
|
|
173
|
+
executables: []
|
|
174
|
+
extensions: []
|
|
175
|
+
extra_rdoc_files: []
|
|
176
|
+
files:
|
|
177
|
+
- ".circleci/config.yml"
|
|
178
|
+
- ".gitignore"
|
|
179
|
+
- ".rubocop.yml"
|
|
180
|
+
- ".ruby-gemset"
|
|
181
|
+
- ".ruby-version"
|
|
182
|
+
- ".travis.yml"
|
|
183
|
+
- Gemfile
|
|
184
|
+
- Gemfile.lock
|
|
185
|
+
- LICENSE.txt
|
|
186
|
+
- README.md
|
|
187
|
+
- Rakefile
|
|
188
|
+
- VERSION
|
|
189
|
+
- bin/console
|
|
190
|
+
- bin/setup
|
|
191
|
+
- boxt_ruby_style_guide.gemspec
|
|
192
|
+
- config.reek
|
|
193
|
+
- default.yml
|
|
194
|
+
- lib/boxt_ruby_style_guide.rb
|
|
195
|
+
- lib/boxt_ruby_style_guide/railtie.rb
|
|
196
|
+
- lib/boxt_ruby_style_guide/version.rb
|
|
197
|
+
- tasks/lint.rake
|
|
198
|
+
homepage: https://github.com/boxt/ruby-style-guide
|
|
199
|
+
licenses:
|
|
200
|
+
- MIT
|
|
201
|
+
metadata: {}
|
|
202
|
+
post_install_message:
|
|
203
|
+
rdoc_options: []
|
|
204
|
+
require_paths:
|
|
205
|
+
- lib
|
|
206
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
|
+
requirements:
|
|
208
|
+
- - ">="
|
|
209
|
+
- !ruby/object:Gem::Version
|
|
210
|
+
version: '0'
|
|
211
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
|
+
requirements:
|
|
213
|
+
- - ">="
|
|
214
|
+
- !ruby/object:Gem::Version
|
|
215
|
+
version: '0'
|
|
216
|
+
requirements: []
|
|
217
|
+
rubyforge_project:
|
|
218
|
+
rubygems_version: 2.7.6
|
|
219
|
+
signing_key:
|
|
220
|
+
specification_version: 4
|
|
221
|
+
summary: Ruby styleguide info for the BOXT Ruby projects
|
|
222
|
+
test_files: []
|