rubocop-rubomatic-rails 1.5.0 → 1.6.0.rc.pre.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: 6c6b2774e2c0c9c9138db48d7035b19ec507f7964099d72eed02a5738fc8bc23
4
- data.tar.gz: e177210a10c03fd02b3adfcd916385519a016aa8ac8f497f4867ce12ee1c3cdd
3
+ metadata.gz: 5614b257728d81e03bc321c02e8444682918e4726e7a0387a7514f05f89036de
4
+ data.tar.gz: cb163c5747e84c71a8304a0d06c5354f1cf25a329643d9cf79a1f4d116d07deb
5
5
  SHA512:
6
- metadata.gz: e4f8eee96ba8d6887e82a0efc97e2c391d0e002481c452b0d2a2c957fd74cc141c79ea8acec8173b26e095f6a7cb0c12ad866d8591612100c33fe5bbd33e2ac0
7
- data.tar.gz: 91b49d8479276cf07590936663c9d4a270ef87b0f6597d8aaa059dce3f34f83e0957f5930697a2c93cc6348d749d366d8d7d2fd6b23668c7ca3b31cea1ebb148
6
+ metadata.gz: 303d606616e08011a8188a5c9d275679a804a144d1b1679c36d2a14f7ef50383c9d12f9c947268425eb7157c3f6ab5d41b5d00f3bb1c363c80956e58f1cd6d90
7
+ data.tar.gz: 1d443a149cfe2b1b51a54615c3e3f985ae7931d8abf0e2e62800fb3a4a302bbaaca6edf62cc28086b387771f06b8930dda62d3770b580aa56eaea7077994e1c3
data/CHANGELOG.adoc CHANGED
@@ -1,3 +1,20 @@
1
+ == 1.6.0 (2025-06-12)
2
+
3
+ * Upgrade to ``ruobcop-rubomatic 1.6.0``
4
+ ** This includes the change from ``require:`` to ``plugins:``.
5
+ While ``require:`` will still work, there will be a deprecation warning
6
+ * Upgrade to ``rubocop-rails 2.32.0``
7
+ ** Enabled ``Rails/MultipleRoutePaths``
8
+ ** Enabled ``Rails/StrongParametersExpect`` (Only in ``Rails 8+``)
9
+ * Added ``rubocop-rspec_rails 2.31.0``
10
+ ** Enabled ``RSpecRails/AvoidSetupHook``
11
+ ** Enabled ``RSpecRails/HaveHttpStatus``
12
+ ** Enabled ``RSpecRails/HttpStatus``
13
+ ** Enabled ``RSpecRails/InferredSpecType``
14
+ ** Enabled ``RSpecRails/MinitestAssertions``
15
+ ** Enabled ``RSpecRails/NegationBeValid``
16
+ ** Enabled ``RSpecRails/TravelAround``
17
+
1
18
  == 1.5.0 (2024-10-23)
2
19
 
3
20
  === Cops
data/config/rails.yml CHANGED
@@ -1,4 +1,4 @@
1
- require: rubocop-rails
1
+ plugins: rubocop-rails
2
2
 
3
3
  Rails/ActionControllerFlashBeforeRender:
4
4
  Enabled: true
@@ -351,6 +351,13 @@ Rails/MigrationClassName:
351
351
  Include:
352
352
  - db/migrate/*.rb
353
353
 
354
+ Rails/MultipleRoutePaths:
355
+ Enabled: true
356
+ Severity: error
357
+ Include:
358
+ - '**/config/routes.rb'
359
+ - '**/config/routes/**/*.rb'
360
+
354
361
  Rails/NegateInclude:
355
362
  Enabled: true
356
363
 
@@ -573,6 +580,11 @@ Rails/SquishedSQLHeredocs:
573
580
  Rails/StripHeredoc:
574
581
  Enabled: true
575
582
 
583
+ Rails/StrongParametersExpect:
584
+ Enabled: <%= `rails -v`.split(' ').last.to_i >= 8 %>
585
+ Include:
586
+ - '**/app/controllers/**/*.rb'
587
+
576
588
  Rails/TableNameAssignment:
577
589
  Enabled: true
578
590
  Include:
@@ -0,0 +1,43 @@
1
+ plugins: rubocop-rspec_rails
2
+
3
+ RSpecRails/AvoidSetupHook:
4
+ Enabled: true
5
+
6
+ RSpecRails/HaveHttpStatus:
7
+ Enabled: true
8
+ ResponseMethods:
9
+ - response
10
+ - last_response
11
+
12
+ RSpecRails/HttpStatus:
13
+ Enabled: true
14
+ EnforcedStyle: symbolic
15
+
16
+ RSpecRails/InferredSpecType:
17
+ Enabled: true
18
+ Inferences:
19
+ channels: channel
20
+ controllers: controller
21
+ features: feature
22
+ generator: generator
23
+ helpers: helper
24
+ jobs: job
25
+ mailboxes: mailbox
26
+ mailers: mailer
27
+ models: model
28
+ requests: request
29
+ integration: request
30
+ api: request
31
+ routing: routing
32
+ system: system
33
+ views: view
34
+
35
+ RSpecRails/MinitestAssertions:
36
+ Enabled: true
37
+
38
+ RSpecRails/NegationBeValid:
39
+ Enabled: true
40
+ EnforcedStyle: be_invalid
41
+
42
+ RSpecRails/TravelAround:
43
+ Enabled: true
data/config/rubocop.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  inherit_from:
2
2
  - ./rails.yml
3
+ - ./rspec_rails.yml
3
4
 
4
5
  inherit_gem:
5
6
  rubocop-rubomatic: config/rubocop.yml
@@ -23,6 +24,7 @@ AllCops:
23
24
  - '.irbrc'
24
25
  - 'db/schema.rb'
25
26
  TargetRubyVersion: <%= ENV['RUBY_MAJOR'] %>
27
+ TargetRailsVersion: <%= `rails -v`.split(' ').last.to_f %>
26
28
  SuggestExtensions: false
27
29
  StyleGuideBaseURL: https://github.com/BrandsInsurance/expert-chainsaw/blob/main/ruby/RUBY_STYLE_GUIDE.adoc
28
30
  ActiveSupportExtensionsEnabled: true
@@ -10,7 +10,7 @@ module RuboCop
10
10
 
11
11
  # :nodoc:
12
12
  def initialize(badge:, **kwargs)
13
- super(badge: badge, **kwargs)
13
+ super
14
14
 
15
15
  @cop = badge.cop_name
16
16
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lint_roller'
4
+
5
+ module RuboCop
6
+ module RubomaticRails
7
+ # A plugin that integrates RuboCop Performance with RuboCop's plugin system.
8
+ class Plugin < LintRoller::Plugin
9
+ # :nodoc:
10
+ def about
11
+ LintRoller::About.new(
12
+ name: 'rubocop-rubomatic-rails',
13
+ version: VERSION::STRING,
14
+ homepage: 'https://github.com/BrandsInsurance/rubocop-rubomatic-rails',
15
+ description: 'A collection of RuboCop cops to check for performance optimizations in Ruby code.'
16
+ )
17
+ end
18
+
19
+ # :nodoc:
20
+ def supported?(context)
21
+ context.engine == :rubocop
22
+ end
23
+
24
+ # :nodoc:
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
32
+ end
33
+ end
34
+ end
@@ -2,6 +2,20 @@
2
2
 
3
3
  module RuboCop
4
4
  module RubomaticRails
5
- VERSION = '1.5.0'
5
+ module VERSION
6
+ MAJOR = 1
7
+ MINOR = 6
8
+ TINY = 0
9
+
10
+ # Set PRE to nil unless it's a pre-release (beta, rc, etc.)
11
+ PRE = 'rc.pre.1'
12
+
13
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.').freeze
14
+
15
+ # @return [String]
16
+ def self.to_s
17
+ STRING
18
+ end
19
+ end
6
20
  end
7
21
  end
@@ -4,9 +4,6 @@ require 'rubocop'
4
4
 
5
5
  require_relative 'rubocop/cop/rubomatic-rails/generator'
6
6
  require_relative 'rubocop/rubomatic-rails'
7
- require_relative 'rubocop/rubomatic-rails/inject'
8
7
  require_relative 'rubocop/rubomatic-rails/version'
9
8
 
10
- RuboCop::RubomaticRails::Inject.defaults!
11
-
12
9
  require_relative 'rubocop/cop/rubomatic_rails_cops'
metadata CHANGED
@@ -1,43 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rubomatic-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0.rc.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-23 00:00:00.000000000 Z
11
+ date: 2025-06-12 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.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.1.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rubocop-rails
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: 2.26.2
33
+ version: 2.32.0
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: 2.26.2
40
+ version: 2.32.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-rspec_rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 2.31.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 2.31.0
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: rubocop-rubomatic
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - "~>"
32
60
  - !ruby/object:Gem::Version
33
- version: 1.5.1
61
+ version: 1.6.0.rc.pre.5
34
62
  type: :runtime
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: 1.5.1
68
+ version: 1.6.0.rc.pre.5
41
69
  description:
42
70
  email:
43
71
  - documents@brandsinsurance.com
@@ -50,6 +78,7 @@ files:
50
78
  - README.adoc
51
79
  - config/default.yml
52
80
  - config/rails.yml
81
+ - config/rspec_rails.yml
53
82
  - config/rubocop.yml
54
83
  - lib/rubocop-rubomatic-rails.rb
55
84
  - lib/rubocop/cop/rubomatic-rails/generator.rb
@@ -57,12 +86,13 @@ files:
57
86
  - lib/rubocop/cop/rubomatic-rails/generator/dept_readme_injector.rb
58
87
  - lib/rubocop/cop/rubomatic_rails_cops.rb
59
88
  - lib/rubocop/rubomatic-rails.rb
60
- - lib/rubocop/rubomatic-rails/inject.rb
89
+ - lib/rubocop/rubomatic-rails/plugin.rb
61
90
  - lib/rubocop/rubomatic-rails/version.rb
62
91
  homepage: https://github.com/BrandsInsurance/rubocop-rubomatic-rails
63
92
  licenses:
64
93
  - MIT
65
94
  metadata:
95
+ default_lint_roller_plugin: RuboCop::RubomaticRails::Plugin
66
96
  rubygems_mfa_required: 'true'
67
97
  homepage_uri: https://github.com/BrandsInsurance/rubocop-rubomatic-rails
68
98
  source_code_uri: https://github.com/BrandsInsurance/rubocop-rubomatic-rails
@@ -78,9 +108,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
108
  version: 3.0.1
79
109
  required_rubygems_version: !ruby/object:Gem::Requirement
80
110
  requirements:
81
- - - ">="
111
+ - - ">"
82
112
  - !ruby/object:Gem::Version
83
- version: '0'
113
+ version: 1.3.1
84
114
  requirements: []
85
115
  rubygems_version: 3.2.15
86
116
  signing_key:
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- module RubomaticRails
5
- module Inject
6
- # This was a generated method from https://github.com/rubocop/rubocop-extension-generator
7
- #
8
- def self.defaults!
9
- path = CONFIG_DEFAULT.to_s
10
- hash = ConfigLoader.__send__(:load_yaml_configuration, path)
11
- config = Config.new(hash, path).tap(&:make_excludes_absolute)
12
-
13
- puts("configuration from #{path}") if ConfigLoader.debug?
14
-
15
- config = ConfigLoader.merge_with_default(config, path)
16
-
17
- ConfigLoader.instance_variable_set(:@default_configuration, config)
18
- end
19
- end
20
- end
21
- end