ruboguide 1.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/.editorconfig +13 -0
- data/.rubocop.yml +2 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +66 -0
- data/LICENSE.txt +21 -0
- data/README.md +48 -0
- data/lib/ruboguide/version.rb +5 -0
- data/lib/ruboguide.rb +7 -0
- data/sig/ruboguide.rbs +4 -0
- data/styles/rubocop-rails.yml +26 -0
- data/styles/rubocop.yml +114 -0
- metadata +126 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2e323fb7829fa6d92391c9cb778f6e1289be1931631afb45a43162d4be223b3a
|
4
|
+
data.tar.gz: 967e7aa1f6888a7052b479aaccd7ac45617ef9c6773f836b8c7948b03b98f223
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 304f82043226cc9f1850cfc34a12b9009c92c82b31a6ab4770789853a34aaba272333542579c931259b45832123c50ed457f70cd7d5d3f8903011f24971de328
|
7
|
+
data.tar.gz: 256ed380e76a7124eba5e4b9817d2ef8632ad4e468f5f678b0c32c6d4c634f2948812e0b3704d6764eaf46bf6fc84eba7c04ea6cf612b8b0ec6c74955b168102
|
data/.editorconfig
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ruboguide (0.1.0)
|
5
|
+
rubocop (= 1.23.0)
|
6
|
+
rubocop-performance (= 1.12.0)
|
7
|
+
rubocop-rails (= 2.12.4)
|
8
|
+
rubocop-rake (= 0.6.0)
|
9
|
+
rubocop-rspec (= 2.6.0)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
activesupport (7.0.4.2)
|
15
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
+
i18n (>= 1.6, < 2)
|
17
|
+
minitest (>= 5.1)
|
18
|
+
tzinfo (~> 2.0)
|
19
|
+
ast (2.4.2)
|
20
|
+
concurrent-ruby (1.2.0)
|
21
|
+
i18n (1.12.0)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
minitest (5.17.0)
|
24
|
+
parallel (1.22.1)
|
25
|
+
parser (3.1.3.0)
|
26
|
+
ast (~> 2.4.1)
|
27
|
+
rack (3.0.2)
|
28
|
+
rainbow (3.1.1)
|
29
|
+
regexp_parser (2.6.1)
|
30
|
+
rexml (3.2.5)
|
31
|
+
rubocop (1.23.0)
|
32
|
+
parallel (~> 1.10)
|
33
|
+
parser (>= 3.0.0.0)
|
34
|
+
rainbow (>= 2.2.2, < 4.0)
|
35
|
+
regexp_parser (>= 1.8, < 3.0)
|
36
|
+
rexml
|
37
|
+
rubocop-ast (>= 1.12.0, < 2.0)
|
38
|
+
ruby-progressbar (~> 1.7)
|
39
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
40
|
+
rubocop-ast (1.24.0)
|
41
|
+
parser (>= 3.1.1.0)
|
42
|
+
rubocop-performance (1.12.0)
|
43
|
+
rubocop (>= 1.7.0, < 2.0)
|
44
|
+
rubocop-ast (>= 0.4.0)
|
45
|
+
rubocop-rails (2.12.4)
|
46
|
+
activesupport (>= 4.2.0)
|
47
|
+
rack (>= 1.1)
|
48
|
+
rubocop (>= 1.7.0, < 2.0)
|
49
|
+
rubocop-rake (0.6.0)
|
50
|
+
rubocop (~> 1.0)
|
51
|
+
rubocop-rspec (2.6.0)
|
52
|
+
rubocop (~> 1.19)
|
53
|
+
ruby-progressbar (1.11.0)
|
54
|
+
tzinfo (2.0.6)
|
55
|
+
concurrent-ruby (~> 1.0)
|
56
|
+
unicode-display_width (2.3.0)
|
57
|
+
|
58
|
+
PLATFORMS
|
59
|
+
ruby
|
60
|
+
x86_64-linux
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
ruboguide!
|
64
|
+
|
65
|
+
BUNDLED WITH
|
66
|
+
2.4.6
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 Researchable
|
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,48 @@
|
|
1
|
+
# Ruboguide
|
2
|
+
|
3
|
+
Ruboguide is Researchable's gem to standardize rubocop configuration, to achieve a uniform style on all ruby projects.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add the following to your Gemfile:
|
8
|
+
```ruby
|
9
|
+
gem 'ruboguide', git: 'https://gitlab.com/researchable/general/gems/ruboguide'
|
10
|
+
```
|
11
|
+
|
12
|
+
If you already have rubocop installed, remove it. This gem already installs rubocop for you (and ensures all projects
|
13
|
+
use the same version of rubocop).
|
14
|
+
|
15
|
+
Edit your `rubocop.yml` to include the following:
|
16
|
+
|
17
|
+
```yaml
|
18
|
+
inherit_gem:
|
19
|
+
ruboguide:
|
20
|
+
- styles/rubocop.yml
|
21
|
+
```
|
22
|
+
|
23
|
+
If your project is a rails project you should instead add:
|
24
|
+
```yaml
|
25
|
+
inherit_gem:
|
26
|
+
ruboguide:
|
27
|
+
- styles/rubocop-rails.yml
|
28
|
+
```
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
This gem gives you rubocop. To lint your codebase, call it the way you normally would e.g.:
|
33
|
+
```shell
|
34
|
+
rubocop -a
|
35
|
+
```
|
36
|
+
|
37
|
+
To run linting on CI using this gem, you can use the CI template available on the
|
38
|
+
[templates/gitlab/base](https://gitlab.com/researchable/general/templates/gitlab/base/-/tree/master/ruby) repository
|
39
|
+
|
40
|
+
## Development
|
41
|
+
|
42
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
43
|
+
|
44
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
45
|
+
|
46
|
+
## License
|
47
|
+
|
48
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/ruboguide.rb
ADDED
data/sig/ruboguide.rbs
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rails
|
3
|
+
|
4
|
+
inherit_from:
|
5
|
+
- rubocop.yml
|
6
|
+
|
7
|
+
# This actually breaks some SQL queries:
|
8
|
+
Rails/PluckInWhere:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
# We call use cases from the console so we want to see output
|
12
|
+
Rails/Output:
|
13
|
+
Exclude:
|
14
|
+
- 'app/use_cases/**/*'
|
15
|
+
|
16
|
+
# The generators are designed to evaluate questionnaire contents as HTML.
|
17
|
+
Rails/OutputSafety:
|
18
|
+
Exclude:
|
19
|
+
- 'app/generators/**/*'
|
20
|
+
|
21
|
+
# We think it's okay to use instance variables in helper classes. We may choose to refactor these
|
22
|
+
# and remove this assertion at a later date.
|
23
|
+
Rails/HelperInstanceVariable:
|
24
|
+
Exclude:
|
25
|
+
- 'app/helpers/**/*'
|
26
|
+
|
data/styles/rubocop.yml
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
NewCops: enable
|
6
|
+
TargetRubyVersion: 3.0
|
7
|
+
Exclude:
|
8
|
+
- 'config/**/*'
|
9
|
+
- 'db/**/*'
|
10
|
+
- 'node_modules/**/*'
|
11
|
+
- 'script/**/*'
|
12
|
+
- 'tmp/**/*'
|
13
|
+
- 'vendor/**/*'
|
14
|
+
- 'Guardfile'
|
15
|
+
- 'bin/*'
|
16
|
+
- 'node_modules/**/*'
|
17
|
+
|
18
|
+
# Use UTF-8 as the source file encoding.
|
19
|
+
Style/Encoding:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/HashEachMethods:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Style/HashTransformKeys:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Style/HashTransformValues:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Style/RedundantRegexpCharacterClass:
|
32
|
+
Enabled: true
|
33
|
+
|
34
|
+
Style/RedundantRegexpEscape:
|
35
|
+
Enabled: true
|
36
|
+
|
37
|
+
Style/RedundantFetchBlock:
|
38
|
+
Enabled: true
|
39
|
+
|
40
|
+
Lint/RaiseException:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
Lint/StructNewOverride:
|
44
|
+
Enabled: true
|
45
|
+
|
46
|
+
Lint/DeprecatedOpenSSLConstant:
|
47
|
+
Enabled: true
|
48
|
+
|
49
|
+
Lint/MixedRegexpCaptureTypes:
|
50
|
+
Enabled: true
|
51
|
+
|
52
|
+
# Limit lines to 80 characters.
|
53
|
+
Layout/LineLength:
|
54
|
+
Max: 120
|
55
|
+
IgnoredPatterns: ['\A#']
|
56
|
+
|
57
|
+
Layout/EndOfLine:
|
58
|
+
EnforcedStyle: lf
|
59
|
+
|
60
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
Layout/SpaceAroundMethodCallOperator:
|
64
|
+
Enabled: true
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
# Default is 5
|
69
|
+
Metrics/ParameterLists:
|
70
|
+
Max: 6
|
71
|
+
|
72
|
+
# Avoid methods longer than 10 lines of code
|
73
|
+
Metrics/MethodLength:
|
74
|
+
CountComments: false # count full line comments?
|
75
|
+
Max: 20
|
76
|
+
|
77
|
+
# Limit modules to have a length of 768
|
78
|
+
Metrics/ModuleLength:
|
79
|
+
Max: 768
|
80
|
+
Exclude:
|
81
|
+
- 'spec/**/*'
|
82
|
+
|
83
|
+
# Describe specs fail this test
|
84
|
+
# Namespaces in rake tasks do too
|
85
|
+
Metrics/BlockLength:
|
86
|
+
Exclude:
|
87
|
+
- 'spec/**/*'
|
88
|
+
- '**/*.rake'
|
89
|
+
- '**/*.gemspec'
|
90
|
+
|
91
|
+
# Limit classes to have a length of 768
|
92
|
+
Metrics/ClassLength:
|
93
|
+
Max: 768
|
94
|
+
|
95
|
+
Metrics/AbcSize:
|
96
|
+
Exclude:
|
97
|
+
- 'spec/**/*'
|
98
|
+
|
99
|
+
################################################################## DISABLED COPS
|
100
|
+
# These cops are disabled because we think they are a Bad Idea. If you add one
|
101
|
+
# here, make sure to add a comment describing what the cop does, and why this
|
102
|
+
# is a bad idea.
|
103
|
+
|
104
|
+
# Forces the argument names of the block given to #reduce to be `a, e`. Only
|
105
|
+
# applies on single-line blocks, but why would we want to force people to use
|
106
|
+
# less descriptive names?
|
107
|
+
Style/Documentation:
|
108
|
+
Enabled: true
|
109
|
+
|
110
|
+
Style/ExponentialNotation:
|
111
|
+
Enabled: true
|
112
|
+
|
113
|
+
Style/SlicingWithRange:
|
114
|
+
Enabled: true
|
metadata
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ruboguide
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Researchable
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-03-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rubocop
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.23.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.23.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-performance
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.12.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.12.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop-rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.12.4
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.12.4
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.6.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.6.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.6.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.6.0
|
83
|
+
description: Ruboguide is all you need to add rubocop to your project. It standardizes
|
84
|
+
the rubocop version and the cops configurations.
|
85
|
+
email:
|
86
|
+
- info@researchable.nl
|
87
|
+
executables: []
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".editorconfig"
|
92
|
+
- ".rubocop.yml"
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- lib/ruboguide.rb
|
98
|
+
- lib/ruboguide/version.rb
|
99
|
+
- sig/ruboguide.rbs
|
100
|
+
- styles/rubocop-rails.yml
|
101
|
+
- styles/rubocop.yml
|
102
|
+
homepage: http://researchable.nl
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata:
|
106
|
+
rubygems_mfa_required: 'true'
|
107
|
+
post_install_message:
|
108
|
+
rdoc_options: []
|
109
|
+
require_paths:
|
110
|
+
- lib
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '3.0'
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
requirements: []
|
122
|
+
rubygems_version: 3.3.26
|
123
|
+
signing_key:
|
124
|
+
specification_version: 4
|
125
|
+
summary: Researchable's rubocop style guide
|
126
|
+
test_files: []
|