rubocop-powerhome 0.7.0 → 0.8.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/.rubocop.yml +1 -1
- data/CHANGELOG.md +11 -1
- data/Gemfile.lock +6 -5
- data/config/default.yml +13 -1
- data/docs/README.md +4 -2
- data/gemfiles/rails_7_1.gemfile.lock +6 -5
- data/gemfiles/rails_7_2.gemfile.lock +6 -5
- data/gemfiles/rails_8_0.gemfile.lock +6 -5
- data/gemfiles/rails_8_1.gemfile.lock +6 -5
- data/lib/rubocop/cop/graphql/default_null_true.rb +1 -1
- data/lib/rubocop/cop/graphql/field_type_in_block.rb +9 -10
- data/lib/rubocop/cop/migration/acknowledge_ignored_column.rb +10 -2
- data/lib/rubocop/cop/migration/down_direction.rb +32 -0
- data/lib/rubocop/cop/migration/rename_column.rb +5 -0
- data/lib/rubocop/cop/migration/rename_table.rb +3 -0
- data/lib/rubocop/cop/migration_cops.rb +2 -0
- data/lib/rubocop/cop/naming/view_component.rb +1 -1
- data/lib/rubocop/powerhome/plugin.rb +29 -0
- data/lib/rubocop/powerhome/version.rb +1 -1
- data/lib/rubocop/powerhome.rb +1 -1
- data/lib/rubocop-powerhome.rb +1 -13
- data/rubocop-powerhome.gemspec +7 -4
- metadata +26 -10
- data/lib/rubocop/powerhome/inject.rb +0 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c15cdfc506d7635ac373cdf73fdffef23d19f3e8162f2c7ad4e5250018a525b
|
|
4
|
+
data.tar.gz: 9bb8a5e0f43b76480b3b775e8e8ddd5809df601765befeab9a80eda08136d521
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 801a2989e6299f66f87d2d9161723e51aa5d26c50b0041b4f949fbdd0620c05a771803a7e8bfc0f4026476bce7a6861509515aed3f9d42d1605862f5c94f3088
|
|
7
|
+
data.tar.gz: 6202ba5bcabd1ed957e76330ee3f9c273ada82c4f1d0f9bb50bafa7107383f3f718519841c13bf8c5f103a5e6f3d39f9f5093181c940d77da6a9ebae260e932e
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.8.0] - 2026-11-23
|
|
4
|
+
|
|
5
|
+
- Move the `Metrics/BlockLength` exemptions for `describe` and `context` from the deprecated `IgnoredMethods` key to `AllowedMethods`, keeping RuboCop's default `refine` exemption
|
|
6
|
+
- rubocop-powerhome is now a RuboCop plugin (lint_roller), replacing the `Inject` config monkey patch. Load it with `plugins: - rubocop-powerhome`; `require:` still works with a deprecation warning
|
|
7
|
+
- **Breaking:** rubocop-performance, rubocop-rails, rubocop-rake and rubocop-rspec are loaded as plugins, so their own default configuration now applies. Previously, with plugin-era versions of those gems, their cops ran without their defaults (for example `Performance/Casecmp` ran although it is disabled by default, and Rails cops ignored their `Include` paths). Requires rubocop-performance >= 1.24, rubocop-rails >= 2.28, rubocop-rake >= 0.7 and rubocop-rspec >= 3.5
|
|
8
|
+
- Migration cops no longer flag rollbacks (`def down`, `dir.down` in `reversible`), and `Migration/AcknowledgeIgnoredColumn` now covers `remove_columns`, `remove_reference`, `remove_belongs_to`, `remove_timestamps` and their `change_table` forms
|
|
9
|
+
- Fix `GraphQL/FieldTypeInBlock` skipping every field declared inside a block (e.g. `included do`), and fix an undefined variable in one of its error messages
|
|
10
|
+
- Fix `Naming/ViewComponent` skipping classes that inherit from an unqualified `ApplicationComponent`
|
|
11
|
+
- Fix `GraphQL/DefaultNullTrue` missing `null: true` when it is not the first keyword argument
|
|
2
12
|
|
|
3
13
|
## [0.7.0] - 2026-07-28
|
|
4
14
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rubocop-powerhome (0.
|
|
4
|
+
rubocop-powerhome (0.8.0)
|
|
5
|
+
lint_roller (~> 1.1)
|
|
5
6
|
rubocop (= 1.82.1)
|
|
6
|
-
rubocop-performance
|
|
7
|
-
rubocop-rails
|
|
8
|
-
rubocop-rake
|
|
9
|
-
rubocop-rspec
|
|
7
|
+
rubocop-performance (>= 1.24)
|
|
8
|
+
rubocop-rails (>= 2.28)
|
|
9
|
+
rubocop-rake (>= 0.7)
|
|
10
|
+
rubocop-rspec (>= 3.5)
|
|
10
11
|
|
|
11
12
|
GEM
|
|
12
13
|
remote: https://rubygems.org/
|
data/config/default.yml
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# rubocop-powerhome bundles these extensions. Listing them here loads each
|
|
2
|
+
# one as a RuboCop plugin, so their own default configuration is applied
|
|
3
|
+
# before the overrides below.
|
|
4
|
+
plugins:
|
|
5
|
+
- rubocop-performance
|
|
6
|
+
- rubocop-rails
|
|
7
|
+
- rubocop-rake
|
|
8
|
+
- rubocop-rspec
|
|
9
|
+
|
|
1
10
|
AllCops:
|
|
2
11
|
TargetRubyVersion: 3.0
|
|
3
12
|
NewCops: enable
|
|
@@ -23,7 +32,10 @@ Lint/ScriptPermission:
|
|
|
23
32
|
Enabled: false
|
|
24
33
|
|
|
25
34
|
Metrics/BlockLength:
|
|
26
|
-
|
|
35
|
+
# Listing AllowedMethods replaces RuboCop's default rather than merging
|
|
36
|
+
# with it, so `refine` is repeated here.
|
|
37
|
+
AllowedMethods:
|
|
38
|
+
- refine
|
|
27
39
|
- describe
|
|
28
40
|
- context
|
|
29
41
|
|
data/docs/README.md
CHANGED
|
@@ -16,15 +16,17 @@ And then execute:
|
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
Add
|
|
19
|
+
Add the plugin to your `.rubocop.yml`:
|
|
20
20
|
|
|
21
21
|
```yml
|
|
22
|
-
|
|
22
|
+
plugins:
|
|
23
23
|
- rubocop-powerhome
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
That's it! You can override the standard configuration after that.
|
|
27
27
|
|
|
28
|
+
rubocop-powerhome is a [RuboCop plugin](https://docs.rubocop.org/rubocop/plugin_migration_guide.html). It also loads rubocop-performance, rubocop-rails, rubocop-rake and rubocop-rspec as plugins, with their own default configuration, so you don't need to list them. Listing `rubocop-powerhome` under `require:` still works but RuboCop prints a deprecation warning.
|
|
29
|
+
|
|
28
30
|
It's recommended that you set `AllCops/TargetRubyVersion` in your project because some cops are Ruby version-dependent. See more [here](https://docs.rubocop.org/rubocop/configuration.html#setting-the-target-ruby-version).
|
|
29
31
|
|
|
30
32
|
## Development
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
rubocop-powerhome (0.
|
|
4
|
+
rubocop-powerhome (0.8.0)
|
|
5
|
+
lint_roller (~> 1.1)
|
|
5
6
|
rubocop (= 1.82.1)
|
|
6
|
-
rubocop-performance
|
|
7
|
-
rubocop-rails
|
|
8
|
-
rubocop-rake
|
|
9
|
-
rubocop-rspec
|
|
7
|
+
rubocop-performance (>= 1.24)
|
|
8
|
+
rubocop-rails (>= 2.28)
|
|
9
|
+
rubocop-rake (>= 0.7)
|
|
10
|
+
rubocop-rspec (>= 3.5)
|
|
10
11
|
|
|
11
12
|
GEM
|
|
12
13
|
remote: https://rubygems.org/
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
rubocop-powerhome (0.
|
|
4
|
+
rubocop-powerhome (0.8.0)
|
|
5
|
+
lint_roller (~> 1.1)
|
|
5
6
|
rubocop (= 1.82.1)
|
|
6
|
-
rubocop-performance
|
|
7
|
-
rubocop-rails
|
|
8
|
-
rubocop-rake
|
|
9
|
-
rubocop-rspec
|
|
7
|
+
rubocop-performance (>= 1.24)
|
|
8
|
+
rubocop-rails (>= 2.28)
|
|
9
|
+
rubocop-rake (>= 0.7)
|
|
10
|
+
rubocop-rspec (>= 3.5)
|
|
10
11
|
|
|
11
12
|
GEM
|
|
12
13
|
remote: https://rubygems.org/
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
rubocop-powerhome (0.
|
|
4
|
+
rubocop-powerhome (0.8.0)
|
|
5
|
+
lint_roller (~> 1.1)
|
|
5
6
|
rubocop (= 1.82.1)
|
|
6
|
-
rubocop-performance
|
|
7
|
-
rubocop-rails
|
|
8
|
-
rubocop-rake
|
|
9
|
-
rubocop-rspec
|
|
7
|
+
rubocop-performance (>= 1.24)
|
|
8
|
+
rubocop-rails (>= 2.28)
|
|
9
|
+
rubocop-rake (>= 0.7)
|
|
10
|
+
rubocop-rspec (>= 3.5)
|
|
10
11
|
|
|
11
12
|
GEM
|
|
12
13
|
remote: https://rubygems.org/
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
rubocop-powerhome (0.
|
|
4
|
+
rubocop-powerhome (0.8.0)
|
|
5
|
+
lint_roller (~> 1.1)
|
|
5
6
|
rubocop (= 1.82.1)
|
|
6
|
-
rubocop-performance
|
|
7
|
-
rubocop-rails
|
|
8
|
-
rubocop-rake
|
|
9
|
-
rubocop-rspec
|
|
7
|
+
rubocop-performance (>= 1.24)
|
|
8
|
+
rubocop-rails (>= 2.28)
|
|
9
|
+
rubocop-rake (>= 0.7)
|
|
10
|
+
rubocop-rspec (>= 3.5)
|
|
10
11
|
|
|
11
12
|
GEM
|
|
12
13
|
remote: https://rubygems.org/
|
|
@@ -28,17 +28,13 @@ module RuboCop
|
|
|
28
28
|
PATTERN
|
|
29
29
|
|
|
30
30
|
def_node_matcher :field_config_with_inline_type_and_block, <<-PATTERN
|
|
31
|
-
|
|
32
|
-
block
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
_
|
|
36
|
-
|
|
37
|
-
)
|
|
31
|
+
{
|
|
32
|
+
(block (send {nil? _} :field sym ${const array} ...) (args) _)
|
|
33
|
+
({numblock itblock} (send {nil? _} :field sym ${const array} ...) _ _)
|
|
34
|
+
}
|
|
38
35
|
PATTERN
|
|
39
36
|
|
|
40
37
|
def on_block(node) # rubocop:disable Metrics/MethodLength
|
|
41
|
-
ignore_node(node)
|
|
42
38
|
field_config_with_inline_type_and_block(node) do |type_const|
|
|
43
39
|
type_const_str = get_type_argument_str(node, type_const)
|
|
44
40
|
if ignore_inline_type_str?(type_const_str)
|
|
@@ -53,9 +49,12 @@ module RuboCop
|
|
|
53
49
|
end
|
|
54
50
|
end
|
|
55
51
|
end
|
|
52
|
+
alias on_numblock on_block
|
|
53
|
+
alias on_itblock on_block
|
|
56
54
|
|
|
57
55
|
def on_send(node) # rubocop:disable Metrics/MethodLength
|
|
58
|
-
|
|
56
|
+
# A field call that opens its own block is handled by on_block.
|
|
57
|
+
return if node.block_node
|
|
59
58
|
|
|
60
59
|
field_config_with_inline_type(node) do |type_const|
|
|
61
60
|
type_const_str = get_type_argument_str(node, type_const)
|
|
@@ -136,7 +135,7 @@ module RuboCop
|
|
|
136
135
|
if indent_test_idx == 0 # rubocop:disable Style/Next
|
|
137
136
|
raise "Invariant: somehow backtracted to beginning of class " \
|
|
138
137
|
"when looking for field indent " \
|
|
139
|
-
"(source: #{
|
|
138
|
+
"(source: #{type_defn_source.inspect})"
|
|
140
139
|
end
|
|
141
140
|
end
|
|
142
141
|
field_indent
|
|
@@ -5,6 +5,9 @@ module RuboCop
|
|
|
5
5
|
# rubocop:disable Lint/RedundantCopDisableDirective
|
|
6
6
|
module Migration
|
|
7
7
|
# Do not remove columns until they are first ignored in production.
|
|
8
|
+
# Covers remove_column(s), remove_reference/remove_belongs_to and
|
|
9
|
+
# remove_timestamps, plus their change_table forms. Rolling back
|
|
10
|
+
# (`def down`, `dir.down`) is not flagged.
|
|
8
11
|
# Verify you have deleted the 'ignored_columns' from the Model and
|
|
9
12
|
# then disable this cop to acknowledge.
|
|
10
13
|
|
|
@@ -26,12 +29,15 @@ module RuboCop
|
|
|
26
29
|
# end
|
|
27
30
|
# end
|
|
28
31
|
class AcknowledgeIgnoredColumn < RuboCop::Cop::Base
|
|
32
|
+
include DownDirection
|
|
33
|
+
|
|
29
34
|
MSG = "Do not remove a column until it is already ignored in production and " \
|
|
30
35
|
"all references to it are removed. Once done, remove the 'ignored_columns' " \
|
|
31
36
|
"from the Model and disable this cop to acknowledge this is safe."
|
|
32
37
|
|
|
33
38
|
def on_send(node)
|
|
34
39
|
return unless remove_column?(node)
|
|
40
|
+
return if in_down_direction?(node)
|
|
35
41
|
|
|
36
42
|
add_offense(node)
|
|
37
43
|
end
|
|
@@ -44,6 +50,8 @@ module RuboCop
|
|
|
44
50
|
return unless block_arg
|
|
45
51
|
|
|
46
52
|
remove_calls(node, block_arg.name) do |rename_node|
|
|
53
|
+
next if in_down_direction?(rename_node)
|
|
54
|
+
|
|
47
55
|
add_offense(rename_node)
|
|
48
56
|
end
|
|
49
57
|
end
|
|
@@ -59,7 +67,7 @@ module RuboCop
|
|
|
59
67
|
def_node_search :remove_calls, <<~PATTERN
|
|
60
68
|
(send
|
|
61
69
|
(lvar %1)
|
|
62
|
-
:remove
|
|
70
|
+
{:remove :remove_references :remove_belongs_to :remove_timestamps}
|
|
63
71
|
...
|
|
64
72
|
)
|
|
65
73
|
PATTERN
|
|
@@ -67,7 +75,7 @@ module RuboCop
|
|
|
67
75
|
def_node_matcher :remove_column?, <<~PATTERN
|
|
68
76
|
(send
|
|
69
77
|
nil?
|
|
70
|
-
:remove_column
|
|
78
|
+
{:remove_column :remove_columns :remove_reference :remove_belongs_to :remove_timestamps}
|
|
71
79
|
...
|
|
72
80
|
)
|
|
73
81
|
PATTERN
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RuboCop
|
|
4
|
+
module Cop
|
|
5
|
+
module Migration
|
|
6
|
+
# Detects code that only runs when a migration is rolled back: a `down`
|
|
7
|
+
# method, or a `dir.down` block inside `reversible do |dir|`. Rollbacks
|
|
8
|
+
# undo an earlier `up`, so the migration cops leave them alone.
|
|
9
|
+
module DownDirection
|
|
10
|
+
extend NodePattern::Macros
|
|
11
|
+
|
|
12
|
+
def_node_matcher :down_block_receiver, "(block (send (lvar $_) :down) ...)"
|
|
13
|
+
def_node_matcher :reversible_block_arg, "(block (send nil? :reversible) (args (arg $_)) _)"
|
|
14
|
+
|
|
15
|
+
def in_down_direction?(node)
|
|
16
|
+
node.each_ancestor(:def, :defs, :block).any? do |ancestor|
|
|
17
|
+
ancestor.block_type? ? reversible_down_block?(ancestor) : ancestor.method?(:down)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def reversible_down_block?(block)
|
|
24
|
+
receiver = down_block_receiver(block)
|
|
25
|
+
return false unless receiver
|
|
26
|
+
|
|
27
|
+
block.each_ancestor(:block).any? { |outer| reversible_block_arg(outer) == receiver }
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -41,11 +41,14 @@ module RuboCop
|
|
|
41
41
|
# end
|
|
42
42
|
# end
|
|
43
43
|
class RenameColumn < RuboCop::Cop::Base
|
|
44
|
+
include DownDirection
|
|
45
|
+
|
|
44
46
|
MSG = "Do not rename columns that are in use. It will cause down time in your application " \
|
|
45
47
|
"and is unsafe for pt-online-schema-change."
|
|
46
48
|
|
|
47
49
|
def on_send(node)
|
|
48
50
|
return unless rename_column?(node)
|
|
51
|
+
return if in_down_direction?(node)
|
|
49
52
|
|
|
50
53
|
add_offense(node)
|
|
51
54
|
end
|
|
@@ -58,6 +61,8 @@ module RuboCop
|
|
|
58
61
|
return unless block_arg
|
|
59
62
|
|
|
60
63
|
rename_calls(node, block_arg.name) do |rename_node|
|
|
64
|
+
next if in_down_direction?(rename_node)
|
|
65
|
+
|
|
61
66
|
add_offense(rename_node)
|
|
62
67
|
end
|
|
63
68
|
end
|
|
@@ -33,11 +33,14 @@ module RuboCop
|
|
|
33
33
|
# end
|
|
34
34
|
# end
|
|
35
35
|
class RenameTable < RuboCop::Cop::Base
|
|
36
|
+
include DownDirection
|
|
37
|
+
|
|
36
38
|
MSG = "Do not rename tables. It will cause down time in your application " \
|
|
37
39
|
"and is unsafe for pt-online-schema-change."
|
|
38
40
|
|
|
39
41
|
def on_send(node)
|
|
40
42
|
return unless rename_table?(node)
|
|
43
|
+
return if in_down_direction?(node)
|
|
41
44
|
|
|
42
45
|
add_offense(node)
|
|
43
46
|
end
|
|
@@ -30,7 +30,7 @@ module RuboCop
|
|
|
30
30
|
private
|
|
31
31
|
|
|
32
32
|
def view_component_class?(inheritance_klass)
|
|
33
|
-
inheritance_klass&.
|
|
33
|
+
inheritance_klass&.match?(/(?:\A|::)(?:ApplicationComponent|ViewComponent::Base)\z/)
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lint_roller"
|
|
4
|
+
|
|
5
|
+
module RuboCop
|
|
6
|
+
module Powerhome
|
|
7
|
+
# Integrates rubocop-powerhome with RuboCop's plugin system. Its default
|
|
8
|
+
# configuration also loads the rubocop-performance, rubocop-rails,
|
|
9
|
+
# rubocop-rake and rubocop-rspec plugins.
|
|
10
|
+
class Plugin < LintRoller::Plugin
|
|
11
|
+
def about
|
|
12
|
+
LintRoller::About.new(
|
|
13
|
+
name: "rubocop-powerhome",
|
|
14
|
+
version: VERSION,
|
|
15
|
+
homepage: "https://github.com/powerhome/power-tools/blob/main/packages/rubocop-powerhome/",
|
|
16
|
+
description: "Powerhome Rubocop standard rules"
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def supported?(context)
|
|
21
|
+
context.engine == :rubocop
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def rules(_context)
|
|
25
|
+
LintRoller::Rules.new(type: :path, config_format: :rubocop, value: CONFIG_DEFAULT)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/rubocop/powerhome.rb
CHANGED
data/lib/rubocop-powerhome.rb
CHANGED
|
@@ -2,20 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
require "rubocop"
|
|
4
4
|
|
|
5
|
+
require_relative "rubocop/powerhome"
|
|
5
6
|
require_relative "rubocop/cop/graphql_cops"
|
|
6
7
|
require_relative "rubocop/cop/migration_cops"
|
|
7
8
|
require_relative "rubocop/cop/naming_cops"
|
|
8
9
|
require_relative "rubocop/cop/style_cops"
|
|
9
|
-
require_relative "rubocop/powerhome"
|
|
10
|
-
|
|
11
|
-
def load_rubocop_extension(extension)
|
|
12
|
-
RuboCop::ConfigLoader.add_loaded_features(extension)
|
|
13
|
-
require extension
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
load_rubocop_extension "rubocop-performance"
|
|
17
|
-
load_rubocop_extension "rubocop-rails"
|
|
18
|
-
load_rubocop_extension "rubocop-rake"
|
|
19
|
-
load_rubocop_extension "rubocop-rspec"
|
|
20
|
-
|
|
21
|
-
RuboCop::Powerhome::Inject.defaults!
|
data/rubocop-powerhome.gemspec
CHANGED
|
@@ -35,12 +35,15 @@ Gem::Specification.new do |spec|
|
|
|
35
35
|
# For more information and examples about making a new gem, check out our
|
|
36
36
|
# guide at: https://bundler.io/guides/creating_gem.html
|
|
37
37
|
|
|
38
|
+
spec.add_dependency "lint_roller", "~> 1.1"
|
|
38
39
|
spec.add_dependency "rubocop", "1.82.1"
|
|
39
|
-
|
|
40
|
-
spec.add_dependency "rubocop-
|
|
41
|
-
spec.add_dependency "rubocop-
|
|
42
|
-
spec.add_dependency "rubocop-
|
|
40
|
+
# The first releases of each extension that ship as RuboCop plugins.
|
|
41
|
+
spec.add_dependency "rubocop-performance", ">= 1.24"
|
|
42
|
+
spec.add_dependency "rubocop-rails", ">= 2.28"
|
|
43
|
+
spec.add_dependency "rubocop-rake", ">= 0.7"
|
|
44
|
+
spec.add_dependency "rubocop-rspec", ">= 3.5"
|
|
43
45
|
spec.metadata["rubygems_mfa_required"] = "true"
|
|
46
|
+
spec.metadata["default_lint_roller_plugin"] = "RuboCop::Powerhome::Plugin"
|
|
44
47
|
|
|
45
48
|
spec.add_development_dependency "appraisal", "~> 2.5.0"
|
|
46
49
|
spec.add_development_dependency "license_finder", "~> 7.0"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-powerhome
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Carlos Palhares
|
|
@@ -10,6 +10,20 @@ bindir: exe
|
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: lint_roller
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.1'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.1'
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
name: rubocop
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -30,56 +44,56 @@ dependencies:
|
|
|
30
44
|
requirements:
|
|
31
45
|
- - ">="
|
|
32
46
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
47
|
+
version: '1.24'
|
|
34
48
|
type: :runtime
|
|
35
49
|
prerelease: false
|
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
51
|
requirements:
|
|
38
52
|
- - ">="
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
54
|
+
version: '1.24'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: rubocop-rails
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
44
58
|
requirements:
|
|
45
59
|
- - ">="
|
|
46
60
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
61
|
+
version: '2.28'
|
|
48
62
|
type: :runtime
|
|
49
63
|
prerelease: false
|
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
65
|
requirements:
|
|
52
66
|
- - ">="
|
|
53
67
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
68
|
+
version: '2.28'
|
|
55
69
|
- !ruby/object:Gem::Dependency
|
|
56
70
|
name: rubocop-rake
|
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
|
58
72
|
requirements:
|
|
59
73
|
- - ">="
|
|
60
74
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
75
|
+
version: '0.7'
|
|
62
76
|
type: :runtime
|
|
63
77
|
prerelease: false
|
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
79
|
requirements:
|
|
66
80
|
- - ">="
|
|
67
81
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
82
|
+
version: '0.7'
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: rubocop-rspec
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
72
86
|
requirements:
|
|
73
87
|
- - ">="
|
|
74
88
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
89
|
+
version: '3.5'
|
|
76
90
|
type: :runtime
|
|
77
91
|
prerelease: false
|
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
93
|
requirements:
|
|
80
94
|
- - ">="
|
|
81
95
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
96
|
+
version: '3.5'
|
|
83
97
|
- !ruby/object:Gem::Dependency
|
|
84
98
|
name: appraisal
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -218,6 +232,7 @@ files:
|
|
|
218
232
|
- lib/rubocop/cop/graphql/root_types_in_block.rb
|
|
219
233
|
- lib/rubocop/cop/graphql_cops.rb
|
|
220
234
|
- lib/rubocop/cop/migration/acknowledge_ignored_column.rb
|
|
235
|
+
- lib/rubocop/cop/migration/down_direction.rb
|
|
221
236
|
- lib/rubocop/cop/migration/rename_column.rb
|
|
222
237
|
- lib/rubocop/cop/migration/rename_table.rb
|
|
223
238
|
- lib/rubocop/cop/migration_cops.rb
|
|
@@ -226,7 +241,7 @@ files:
|
|
|
226
241
|
- lib/rubocop/cop/style/no_helpers.rb
|
|
227
242
|
- lib/rubocop/cop/style_cops.rb
|
|
228
243
|
- lib/rubocop/powerhome.rb
|
|
229
|
-
- lib/rubocop/powerhome/
|
|
244
|
+
- lib/rubocop/powerhome/plugin.rb
|
|
230
245
|
- lib/rubocop/powerhome/version.rb
|
|
231
246
|
- mkdocs.yml
|
|
232
247
|
- rubocop-powerhome.gemspec
|
|
@@ -239,6 +254,7 @@ metadata:
|
|
|
239
254
|
source_code_uri: https://github.com/powerhome/power-tools/blob/main/packages/rubocop-powerhome/
|
|
240
255
|
changelog_uri: https://github.com/powerhome/power-tools/blob/main/packages/rubocop-powerhome//CHANGELOG.md
|
|
241
256
|
rubygems_mfa_required: 'true'
|
|
257
|
+
default_lint_roller_plugin: RuboCop::Powerhome::Plugin
|
|
242
258
|
rdoc_options: []
|
|
243
259
|
require_paths:
|
|
244
260
|
- lib
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# The original code is from https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
|
|
4
|
-
# See https://github.com/rubocop/rubocop-rspec/blob/master/MIT-LICENSE.md
|
|
5
|
-
module RuboCop
|
|
6
|
-
module Powerhome
|
|
7
|
-
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
|
8
|
-
# bit of our configuration.
|
|
9
|
-
module Inject
|
|
10
|
-
def self.defaults!
|
|
11
|
-
path = CONFIG_DEFAULT.to_s
|
|
12
|
-
hash = ConfigLoader.send(:load_yaml_configuration, path)
|
|
13
|
-
config = Config.new(hash, path).tap(&:make_excludes_absolute)
|
|
14
|
-
puts "configuration from #{path}" if ConfigLoader.debug?
|
|
15
|
-
config = ConfigLoader.merge_with_default(config, path)
|
|
16
|
-
ConfigLoader.instance_variable_set(:@default_configuration, config)
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|