rubocop-view_component 0.5.1 → 0.7.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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +33 -0
  3. data/Appraisals +5 -0
  4. data/CLAUDE.md +6 -14
  5. data/README.md +18 -7
  6. data/Rakefile +3 -5
  7. data/config/default.yml +4 -1
  8. data/gemfiles/rubocop_minimum.gemfile +13 -0
  9. data/gemfiles/rubocop_minimum.gemfile.lock +162 -0
  10. data/lib/rubocop/cop/view_component/base.rb +51 -9
  11. data/lib/rubocop/cop/view_component/missing_preview.rb +9 -7
  12. data/lib/rubocop/cop/view_component/no_global_state.rb +14 -0
  13. data/lib/rubocop/cop/view_component/prefer_private_methods.rb +15 -13
  14. data/lib/rubocop/cop/view_component/prefer_slots.rb +10 -15
  15. data/lib/rubocop/cop/view_component/template_analyzer.rb +19 -19
  16. data/lib/rubocop/cop/view_component/test_rendered_output.rb +4 -1
  17. data/lib/rubocop/view_component/version.rb +1 -1
  18. data/script/verify +16 -17
  19. data/spec/expected_govuk_failures.yml +2 -0
  20. data/spec/expected_polaris_failures.yml +0 -1
  21. data/spec/expected_primer_failures.yml +3 -0
  22. data/spec/rubocop/cop/view_component/base_spec.rb +92 -0
  23. data/spec/rubocop/cop/view_component/component_suffix_spec.rb +0 -33
  24. data/spec/rubocop/cop/view_component/missing_preview_spec.rb +83 -5
  25. data/spec/rubocop/cop/view_component/no_global_state_spec.rb +13 -0
  26. data/spec/rubocop/cop/view_component/prefer_composition_spec.rb +0 -17
  27. data/spec/rubocop/cop/view_component/prefer_private_methods_spec.rb +3 -3
  28. data/spec/rubocop/cop/view_component/test_rendered_output_spec.rb +1 -1
  29. data/spec/spec_helper.rb +10 -0
  30. data/spec/support/project_index_helpers.rb +71 -0
  31. data/verification/govuk_rubocop_config.yml +3 -3
  32. data/verification/polaris_rubocop_config.yml +3 -4
  33. data/verification/primer_rubocop_config.yml +5 -4
  34. metadata +39 -5
@@ -1,7 +1,6 @@
1
- ViewComponent:
2
- ViewComponentParentClasses:
3
- - Primer::Component
4
- - Primer::BaseComponent
1
+ AllCops:
2
+ UseProjectIndex: true
3
+ ProjectIndexIncludesGems: true
5
4
 
6
5
  # Primer seems to intentionally omit the Component suffix from most class names
7
6
  # (116 out of 131 components), so this cop is not useful here.
@@ -28,3 +27,5 @@ ViewComponent/MissingPreview:
28
27
  - previews
29
28
  Exclude:
30
29
  - app/components/primer/base_component.rb
30
+ # Deprecated wrapper with no preview
31
+ - app/components/primer/navigation/tab_component.rb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-view_component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Waite
@@ -9,6 +9,20 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: activesupport
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: herb
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -51,20 +65,34 @@ dependencies:
51
65
  - - ">="
52
66
  - !ruby/object:Gem::Version
53
67
  version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: rubydex
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
54
82
  - !ruby/object:Gem::Dependency
55
83
  name: rubocop
56
84
  requirement: !ruby/object:Gem::Requirement
57
85
  requirements:
58
86
  - - ">="
59
87
  - !ruby/object:Gem::Version
60
- version: 1.72.2
88
+ version: 1.89.0
61
89
  type: :runtime
62
90
  prerelease: false
63
91
  version_requirements: !ruby/object:Gem::Requirement
64
92
  requirements:
65
93
  - - ">="
66
94
  - !ruby/object:Gem::Version
67
- version: 1.72.2
95
+ version: 1.89.0
68
96
  description: A RuboCop extension that enforces ViewComponent best practices and conventions
69
97
  email:
70
98
  - andyw8@users.noreply.github.com
@@ -74,11 +102,14 @@ extra_rdoc_files: []
74
102
  files:
75
103
  - ".rspec"
76
104
  - ".rubocop.yml"
105
+ - Appraisals
77
106
  - CLAUDE.md
78
107
  - LICENSE.txt
79
108
  - README.md
80
109
  - Rakefile
81
110
  - config/default.yml
111
+ - gemfiles/rubocop_minimum.gemfile
112
+ - gemfiles/rubocop_minimum.gemfile.lock
82
113
  - lib/rubocop-view_component.rb
83
114
  - lib/rubocop/cop/view_component/base.rb
84
115
  - lib/rubocop/cop/view_component/component_suffix.rb
@@ -99,6 +130,7 @@ files:
99
130
  - spec/expected_primer_failures.yml
100
131
  - spec/fixtures/components/template_method_component.html.erb
101
132
  - spec/fixtures/components/template_method_component.rb
133
+ - spec/rubocop/cop/view_component/base_spec.rb
102
134
  - spec/rubocop/cop/view_component/component_suffix_spec.rb
103
135
  - spec/rubocop/cop/view_component/missing_preview_spec.rb
104
136
  - spec/rubocop/cop/view_component/no_global_state_spec.rb
@@ -107,6 +139,7 @@ files:
107
139
  - spec/rubocop/cop/view_component/prefer_slots_spec.rb
108
140
  - spec/rubocop/cop/view_component/test_rendered_output_spec.rb
109
141
  - spec/spec_helper.rb
142
+ - spec/support/project_index_helpers.rb
110
143
  - verification/govuk_rubocop_config.yml
111
144
  - verification/libraries.yml
112
145
  - verification/polaris_rubocop_config.yml
@@ -118,6 +151,7 @@ metadata:
118
151
  homepage_uri: https://github.com/andyw8/rubocop-view_component
119
152
  source_code_uri: https://github.com/andyw8/rubocop-view_component
120
153
  default_lint_roller_plugin: RuboCop::ViewComponent::Plugin
154
+ rubygems_mfa_required: 'true'
121
155
  rdoc_options: []
122
156
  require_paths:
123
157
  - lib
@@ -125,14 +159,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
159
  requirements:
126
160
  - - ">="
127
161
  - !ruby/object:Gem::Version
128
- version: 2.7.0
162
+ version: 3.2.0
129
163
  required_rubygems_version: !ruby/object:Gem::Requirement
130
164
  requirements:
131
165
  - - ">="
132
166
  - !ruby/object:Gem::Version
133
167
  version: '0'
134
168
  requirements: []
135
- rubygems_version: 3.6.9
169
+ rubygems_version: 4.0.16
136
170
  specification_version: 4
137
171
  summary: RuboCop extension for ViewComponent best practices
138
172
  test_files: []