rubocop-katalyst 2.1.2 → 2.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c43e375e321c1382b1e7c0452c2d475e9c33cc759bc3ed507c4bc0448a3456f2
4
- data.tar.gz: 8ec0b91d80f07088a751b0619bb2e8ae68d904e7c5f59741dfceefeeea301565
3
+ metadata.gz: 16fa4be27361977e3c61e9c907dbadff73043e7fa97eaf1e9dd77f64beb077c9
4
+ data.tar.gz: fc91034972c8fdcfbf804b1049e2812c3b56a8479f6348a1d36660d9553dfa96
5
5
  SHA512:
6
- metadata.gz: 1ee6e5eeb76ba5a432c6e9cadf4ce77df6eb09835882277a7a9b14ffa0c2e267763aa5524d6c1ebf6785071f24b692df2ab547f407327b18c606fc0cbf8bc313
7
- data.tar.gz: 9b4920e3186408778a1c0eab9a2fae1e317b465c2735c38bc830b8c02d443baee8fc5c331253a5c65ef50f329e33bb7fa084d166d037430fcea49e755c961904
6
+ metadata.gz: 0f1f6e7aa2469b7c75f7a2969bb4567a243a6e41ffb084600315fe9b8098d8215582721c3a64d6123097ea02d5b565e1cba42c8cf1f1a26a8c71332bb2cf2456
7
+ data.tar.gz: 064e9d7bb014b34ef508096cc6428ea9fd2905290e8b9de333467a5ae70716f808d7e438816d20ad308b2cff9f7fe04eb91b25e4eb54422ef335ead1da355606
data/config/default.yml CHANGED
@@ -1,13 +1,11 @@
1
1
  # Configuration for all cops and global extension configuration
2
2
  plugins:
3
+ - rubocop-capybara
3
4
  - rubocop-factory_bot
4
5
  - rubocop-performance
5
6
  - rubocop-rails
6
7
  - rubocop-rake
7
8
  - rubocop-rspec
8
-
9
- require:
10
- - rubocop-capybara
11
9
  - rubocop-rspec_rails
12
10
 
13
11
  inherit_mode:
@@ -20,9 +20,9 @@ Naming/FileName:
20
20
  StyleGuide: 'https://github.com/rubocop/ruby-style-guide#snake-case-files'
21
21
  Enabled: false
22
22
 
23
- Naming/PredicateName:
24
- Description: 'Check the names of predicate methods.'
25
- StyleGuide: 'https://github.com/rubocop/ruby-style-guide#bool-methods-qmark'
23
+ Naming/PredicatePrefix:
24
+ Description: 'Check the prefix of predicate methods.'
25
+ StyleGuide: 'https://github.com/rubocop/ruby-style-guide#predicate-methods-prefix'
26
26
  ForbiddenPrefixes:
27
27
  - is_
28
28
  Exclude:
@@ -6,17 +6,39 @@ require "rubocop-rails"
6
6
  require "rubocop-rake"
7
7
  require "rubocop-rspec"
8
8
 
9
- require_relative "katalyst/inject"
10
-
11
9
  module RuboCop
12
10
  module Katalyst
13
- class Error < StandardError; end
14
- PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
15
- CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
16
- CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
11
+ class Plugin < LintRoller::Plugin
12
+ def about
13
+ LintRoller::About.new(
14
+ name: "rubocop-katalyst",
15
+ version:,
16
+ homepage: "https://github.com/katalyst/rubocop-katalyst",
17
+ description: "Rubocop configuration for Katalyst projects.",
18
+ )
19
+ end
20
+
21
+ def supported?(context)
22
+ context.engine == :rubocop
23
+ end
24
+
25
+ def rules(_context)
26
+ LintRoller::Rules.new(
27
+ type: :path,
28
+ config_format: :rubocop,
29
+ value: Pathname.new(__dir__).join("../../config/default.yml"),
30
+ )
31
+ end
17
32
 
18
- private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
33
+ private
34
+
35
+ def version
36
+ Gem::Specification.find_by_name("rubocop-katalyst").version
37
+ end
38
+
39
+ def project_root
40
+ Pathname.new(__dir__).join("../..")
41
+ end
42
+ end
19
43
  end
20
44
  end
21
-
22
- RuboCop::Katalyst::Inject.defaults!
data/package.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "autocorrect": "prettier --write *.json app/assets/javascripts app/assets/stylesheets"
6
6
  },
7
7
  "devDependencies": {
8
- "prettier": "3.3.2"
8
+ "prettier": "3.5.3"
9
9
  }
10
10
  }
metadata CHANGED
@@ -1,14 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-katalyst
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-06 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: lint_roller
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: rubocop
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -146,7 +160,6 @@ files:
146
160
  - config/rubocop-style.yml
147
161
  - lib/rubocop/katalyst.rb
148
162
  - lib/rubocop/katalyst/erb_lint_task.rb
149
- - lib/rubocop/katalyst/inject.rb
150
163
  - lib/rubocop/katalyst/prettier_task.rb
151
164
  - lib/rubocop/katalyst/rake_task.rb
152
165
  - lib/tasks/erb_lint.rake
@@ -157,6 +170,7 @@ licenses:
157
170
  metadata:
158
171
  allowed_push_host: https://rubygems.org
159
172
  rubygems_mfa_required: 'true'
173
+ default_lint_roller_plugin: RuboCop::Katalyst::Plugin
160
174
  rdoc_options: []
161
175
  require_paths:
162
176
  - lib
@@ -171,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
185
  - !ruby/object:Gem::Version
172
186
  version: '0'
173
187
  requirements: []
174
- rubygems_version: 3.6.2
188
+ rubygems_version: 3.6.7
175
189
  specification_version: 4
176
190
  summary: Code standards for Katalyst
177
191
  test_files: []
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # The original code is from https://github.com/rubocop-hq/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
4
- # See https://github.com/rubocop-hq/rubocop-rspec/blob/master/MIT-LICENSE.md
5
- module RuboCop
6
- module Katalyst
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_file, File.new(path))
13
- config = RuboCop::Config.new(hash, path)
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