rubocop-dbl 1.1.0 → 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 +4 -4
- data/README.md +22 -62
- data/config/cops/metrics.yml +7 -0
- data/config/dbl.yml +1 -3
- data/lib/generators/rubocop_dbl/install_generator.rb +18 -6
- data/lib/rubocop_dbl/version.rb +1 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8fe3d4a4f7e6815e04cb657a97fbac59d0a376bec3b02f3935f5932f42f6b38
|
4
|
+
data.tar.gz: 2cfc77717d8b79375e569d0dce3743505eebde4ef449bdc42ec1e2309111c0e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 684c2c5dc56489b9c645c0806169a1b0721c8734fe092748f5b3a68e4a340d08004e544dd34fdeaf4b8fedf6a47d06235b87f29fca160646c7c499d47a610fea
|
7
|
+
data.tar.gz: 13db56ad3a82a228a1ac8e7024975552df2942b8721fdd0a7087f626483189d5a639bf90f04ec1ee6d6ae89c909c911c8faf3d919276b1c50774ddea001ffc4d
|
data/README.md
CHANGED
@@ -6,70 +6,56 @@ RuboCop configuration for our Ruby on Rails projects.
|
|
6
6
|
|
7
7
|
[Official RoR RuboCop Configuration](https://github.com/rails/rails/blob/master/.rubocop.yml).
|
8
8
|
|
9
|
-
Releases are published to [
|
10
|
-
|
9
|
+
Releases are published to [RubyGems](https://rubygems.org/gems/rubocop-dbl).
|
11
10
|
|
12
11
|
## Installation
|
13
12
|
|
14
|
-
Install from command line:
|
15
|
-
|
16
|
-
```shell
|
17
|
-
gem install rubocop-dbl --version "0.2.0" --source "https://rubygems.pkg.github.com/dbl-works"
|
18
|
-
```
|
19
|
-
|
20
|
-
install via Gemfile:
|
21
|
-
|
22
|
-
DO NOT DO THIS:
|
23
13
|
```ruby
|
24
14
|
group :development, :test do
|
25
|
-
gem
|
15
|
+
gem 'rubocop-dbl'
|
26
16
|
end
|
27
17
|
```
|
28
18
|
|
29
|
-
|
19
|
+
## Setup
|
30
20
|
|
31
|
-
|
32
|
-
# Gemfile
|
33
|
-
group :development, :test do
|
34
|
-
gem 'rubocop-dbl', git: 'git@github.com:dbl-works/rubocop-dbl', branch: :main
|
35
|
-
end
|
36
|
-
```
|
37
|
-
WHY: we cannot install a public (!!) package from GitHub packages without a PAT (personal access token), see this [thread](https://github.community/t/download-from-github-package-registry-without-authentication/14407).
|
38
|
-
E.g. CircleCI does not allow reading a ENV var within the ci.yml, hence it is impossible to configure bundle to have auth for GitHub packages (this might work using GitHub actions).
|
21
|
+
run
|
39
22
|
|
23
|
+
```shell
|
24
|
+
rails generate rubocop_dbl:install
|
25
|
+
```
|
40
26
|
|
41
|
-
|
27
|
+
or manually Aad this line to your application's `.rubocop.yml`:
|
42
28
|
|
43
|
-
|
29
|
+
When using Rails:
|
44
30
|
|
45
31
|
```yml
|
32
|
+
require:
|
33
|
+
- rubocop-rails
|
34
|
+
|
46
35
|
inherit_gem:
|
47
36
|
rubocop-dbl:
|
48
37
|
- config/dbl.yml
|
38
|
+
- config/cops/rails.yml
|
49
39
|
```
|
50
40
|
|
51
|
-
|
41
|
+
When not using Rails:
|
52
42
|
|
53
|
-
```
|
54
|
-
|
43
|
+
```yml
|
44
|
+
inherit_gem:
|
45
|
+
rubocop-dbl:
|
46
|
+
- config/dbl.yml
|
55
47
|
```
|
56
48
|
|
57
|
-
|
58
|
-
|
59
49
|
## Configuration
|
60
50
|
|
61
|
-
|
62
51
|
### TargetRubyVersion
|
63
52
|
|
64
53
|
We only support the latest 2 versions of ruby, which is currently >= 2.7.
|
65
54
|
We only support the latest 2 versions of rails, which is currently >= 6.0.
|
66
55
|
See [test.yml](.github/workflows/test.yml) for details.
|
67
56
|
|
68
|
-
|
69
57
|
If you'd like to change `TargetRubyVersion`, see [Customization](#customization).
|
70
58
|
|
71
|
-
|
72
|
-
|
73
59
|
## Customization
|
74
60
|
|
75
61
|
If you'd like to customize the rubocop setting on your project, you can override it.
|
@@ -88,42 +74,16 @@ AllCops:
|
|
88
74
|
```
|
89
75
|
|
90
76
|
## Build & install gem locally
|
91
|
-
```shell
|
92
|
-
gem build rubocop-dbl.gemspec
|
93
|
-
gem install rubocop-dbl-0.1.0.gem
|
94
|
-
irb
|
95
|
-
```
|
96
|
-
|
97
|
-
## Publish as package on GitHub packages
|
98
|
-
* create a valid PAT (personal access token) for your GitHub user with full access to packages (read & write) and private repos (read), read the [docs](https://docs.github.com/en/free-pro-team@latest/packages/guides/configuring-rubygems-for-use-with-github-packages) for more details
|
99
|
-
* add following information to `~/.gemrc`:
|
100
|
-
|
101
|
-
```
|
102
|
-
---
|
103
|
-
:github: YOUR_PAT
|
104
|
-
:backtrace: false
|
105
|
-
:bulk_threshold: 1000
|
106
|
-
:sources:
|
107
|
-
- https://rubygems.org/
|
108
|
-
- https://rubygems.pkg.github.com
|
109
|
-
:update_sources: true
|
110
|
-
:verbose: true
|
111
|
-
:concurrent_downloads: 8
|
112
|
-
gem: "--document=yri"
|
113
|
-
|
114
|
-
```
|
115
|
-
|
116
|
-
* build the latest version of the gem locally with
|
117
77
|
|
118
78
|
```shell
|
119
79
|
gem build rubocop-dbl.gemspec
|
80
|
+
gem install rubocop-dbl-0.1.0.gem
|
120
81
|
```
|
121
|
-
take note of the most current version of the gem, which will be printed to console.
|
122
82
|
|
123
|
-
|
83
|
+
## Publish on RubyGems
|
124
84
|
|
125
85
|
```shell
|
126
|
-
|
86
|
+
bin/release
|
127
87
|
```
|
128
88
|
|
129
|
-
|
89
|
+
will guide you through the process.
|
data/config/cops/metrics.yml
CHANGED
data/config/dbl.yml
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-packaging
|
3
3
|
- rubocop-performance
|
4
|
-
- rubocop-rails
|
5
4
|
- rubocop-rspec
|
6
5
|
- rubocop-sorbet
|
7
6
|
|
@@ -12,7 +11,6 @@ inherit_from:
|
|
12
11
|
- cops/metrics.yml
|
13
12
|
- cops/naming.yml
|
14
13
|
- cops/performance.yml
|
15
|
-
- cops/rails.yml
|
16
14
|
- cops/rspec.yml
|
17
15
|
- cops/style.yml
|
18
16
|
- cops/types.yml
|
@@ -22,7 +20,7 @@ inherit_from:
|
|
22
20
|
# see: https://docs.rubocop.org/rubocop/usage/caching.html
|
23
21
|
AllCops:
|
24
22
|
UseCache: true
|
25
|
-
TargetRubyVersion:
|
23
|
+
TargetRubyVersion: 3.1.4
|
26
24
|
NewCops: enable
|
27
25
|
Exclude:
|
28
26
|
- '**/tmp/**/*'
|
@@ -1,13 +1,12 @@
|
|
1
1
|
# typed: false
|
2
2
|
|
3
3
|
require 'rails/generators/base'
|
4
|
-
require 'active_support/core_ext/string'
|
5
4
|
require 'railties'
|
6
5
|
|
7
6
|
module RubocopDbl
|
8
7
|
module Generators
|
9
8
|
class InstallGenerator < Rails::Generators::Base
|
10
|
-
desc 'Creates a .rubocop.yml config file that inherits from the
|
9
|
+
desc 'Creates a .rubocop.yml config file that inherits from the various rubocop gems (Rails optional).'
|
11
10
|
|
12
11
|
def create_config_file
|
13
12
|
file_method = config_file_exists? ? :prepend : :create
|
@@ -25,11 +24,24 @@ module RubocopDbl
|
|
25
24
|
end
|
26
25
|
|
27
26
|
def config_file_content
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
if defined?(Rails)
|
28
|
+
<<~HEREDOC
|
29
|
+
require:
|
30
|
+
- rubocop-rails
|
31
|
+
|
32
|
+
inherit_gem:
|
33
|
+
rubocop-dbl:
|
34
|
+
- config/dbl.yml
|
35
|
+
- config/cops/rails.yml
|
36
|
+
HEREDOC
|
37
|
+
else
|
38
|
+
<<~HEREDOC
|
39
|
+
|
40
|
+
inherit_gem:
|
41
|
+
rubocop-dbl:
|
31
42
|
- config/dbl.yml
|
32
|
-
|
43
|
+
HEREDOC
|
44
|
+
end
|
33
45
|
end
|
34
46
|
end
|
35
47
|
end
|
data/lib/rubocop_dbl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-dbl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 'Team DBL :rocket:'
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop-rails
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '2'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '2'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rubocop-rspec
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,14 +127,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
127
|
requirements:
|
142
128
|
- - ">="
|
143
129
|
- !ruby/object:Gem::Version
|
144
|
-
version: '
|
130
|
+
version: '3.1'
|
145
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
132
|
requirements:
|
147
133
|
- - ">="
|
148
134
|
- !ruby/object:Gem::Version
|
149
135
|
version: '0'
|
150
136
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
137
|
+
rubygems_version: 3.5.3
|
152
138
|
signing_key:
|
153
139
|
specification_version: 4
|
154
140
|
summary: RuboCop configuration for our Ruby on Rails projects
|