runger_style 5.6.0 → 5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46c8dd4a66ab7a5c4cc4e85f6eb30c32231cd9239e31966ef24ef79dcb784d4f
4
- data.tar.gz: 0bcf2c8461c4016d99db10173549f954172704eb35c8244a44f49829d32774b6
3
+ metadata.gz: d5e730830fe1047b48c1b164d9fe75077212ddc755b69de830a055096e96edf0
4
+ data.tar.gz: 1135cdb63db280a9eb50ed20b0b81709331034c41d8bae7feebb3aed7a3d3589
5
5
  SHA512:
6
- metadata.gz: d65e0c70b7a6951a5d7dcc53c680176f0afe0f043e141548d6c2d9e86ddc942841900879e0caeec350ba3cd8fb7ac579e330dc3a1f08f18b243b37864dd21db5
7
- data.tar.gz: 9eaef8530ec93cf560f2ff230363af55971c2e4bc06ee547703e5eab300bf8062404f24119dd6d3dd5dd14763e049ccc3e451a2364d6c4b5944d813a3f80b361
6
+ metadata.gz: aad4fd7aae84f1a1d4b846e42643f10cad2c438061c6225a5bf81ac969cabe98d8273ca2f253d0a00c11214a743f8f130815794fa432e2fc00405ae10d7fa2f5
7
+ data.tar.gz: d948ea9b48164ab543367685949059ddb0a77e0c6fac373f35356508b8983bae785752cd99e125c6308f229a8234bf96d3f1158a516faabb74fcd205e0379f56
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v5.7.0 (2025-03-10)
2
+ - Disable `Capybara/AmbiguousClick` and `Capybara/ClickLinkOrButtonStyle` and add `RungerStyle/ClickAmbiguously`, which does the opposite of `Capybara/AmbiguousClick`, i.e. it requires the use of `click_on` and forbids the use of `click_button` or `click_link`.
3
+
4
+ ### Internal
5
+ - Move default custom cops and monkeypatches to `default/` subdirectory. This will make it possible to also add cops/monkeypatches for other plugins in other subdirectories (e.g. capybara) that we don't want to require/include in the default config.
6
+
1
7
  ## v5.6.0 (2025-03-10)
2
8
  - Switch from `require` to `plugins` for `rubocop-rspec_rails` ruleset (`rulesets/rspec_rails.yml`).
3
9
  - Switch from `require` to `plugins` for `rubocop-capybara` ruleset (`rulesets/capybara.yml`).
data/Gemfile.lock CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- runger_style (5.6.0)
12
+ runger_style (5.7.0)
13
13
  prism (>= 0.24.0)
14
14
  rubocop (>= 1.72.0)
15
15
 
@@ -221,7 +221,7 @@ CHECKSUMS
221
221
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
222
222
  runger_byebug (11.4.0) sha256=569e22ba2215f57e7f69e145fcb63be401e29fcd312f7936d813e12d0c7bbee6
223
223
  runger_release_assistant (2.0.0) sha256=f4f5708291eaeef1b881208f87a494877fe768739d6e96b7293fc335b28a3865
224
- runger_style (5.6.0)
224
+ runger_style (5.7.0)
225
225
  securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
226
226
  slop (4.10.1) sha256=844322b5ffcf17ed4815fdb173b04a20dd82b4fd93e3744c88c8fafea696d9c7
227
227
  stringio (3.1.5) sha256=bca92461515a131535743bc81d5559fa1de7d80cff9a654d6c0af6f9f27e35c8
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RungerStyle # rubocop:disable Style/ClassAndModuleChildren
4
+ class ClickAmbiguously < ::RuboCop::Cop::Base
5
+ extend ::RuboCop::Cop::AutoCorrector
6
+ MSG = 'Use `click_on` instead of `click_link` or `click_button`.'
7
+ RESTRICT_ON_SEND = %i[click_button click_link].freeze
8
+
9
+ def on_send(node)
10
+ add_offense(node) do |corrector|
11
+ corrector.replace(node.loc.selector, 'click_on')
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ Dir[File.expand_path('./**/*.rb', __dir__)].each do |file|
4
+ unless file == __FILE__
5
+ require file
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ Dir[File.expand_path('./monkeypatches/**/*.rb', __dir__)].each do |file|
4
+ require file
5
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RungerStyle
4
- VERSION = '5.6.0'
4
+ VERSION = '5.7.0'
5
5
  end
data/lib/runger_style.rb CHANGED
@@ -4,5 +4,5 @@ require 'rubocop'
4
4
 
5
5
  module RungerStyle ; end
6
6
 
7
- require 'runger_style/cops/require_all_custom_cops'
7
+ require 'runger_style/cops/default/require_all_custom_cops'
8
8
  require 'runger_style/version'
@@ -1,7 +1,16 @@
1
+ require:
2
+ - ../lib/runger_style/cops/capybara/require_all_custom_cops.rb
3
+
1
4
  plugins:
2
5
  - rubocop-capybara
3
6
 
7
+ Capybara/AmbiguousClick:
8
+ Enabled: false
9
+ Capybara/ClickLinkOrButtonStyle:
10
+ Enabled: false
4
11
  Capybara/NegationMatcher:
5
12
  EnforcedStyle: not_to
6
13
  Capybara/SpecificMatcher:
7
14
  Enabled: false
15
+ RungerStyle/ClickAmbiguously:
16
+ Enabled: true
data/rulesets/default.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  require:
2
- - ../lib/runger_style/cops/require_all_custom_cops.rb
2
+ - ../lib/runger_style/cops/default/require_all_custom_cops.rb
3
3
 
4
4
  AllCops:
5
5
  EnabledByDefault: true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runger_style
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.0
4
+ version: 5.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger
@@ -66,14 +66,16 @@ files:
66
66
  - bin/rspec
67
67
  - bin/rubocop
68
68
  - lib/runger_style.rb
69
- - lib/runger_style/cops/argument_alignment.rb
70
- - lib/runger_style/cops/first_argument_indentation.rb
71
- - lib/runger_style/cops/multiline_hash_value_indentation.rb
72
- - lib/runger_style/cops/multiline_method_arguments_line_breaks.rb
73
- - lib/runger_style/cops/require_all_custom_cops.rb
74
- - lib/runger_style/cops/require_all_monkeypatches.rb
75
- - lib/runger_style/monkeypatches/multiline_element_line_breaks.rb
76
- - lib/runger_style/monkeypatches/multiline_expression_indentation.rb
69
+ - lib/runger_style/cops/capybara/click_ambiguously.rb
70
+ - lib/runger_style/cops/capybara/require_all_custom_cops.rb
71
+ - lib/runger_style/cops/default/argument_alignment.rb
72
+ - lib/runger_style/cops/default/first_argument_indentation.rb
73
+ - lib/runger_style/cops/default/monkeypatches/multiline_element_line_breaks.rb
74
+ - lib/runger_style/cops/default/monkeypatches/multiline_expression_indentation.rb
75
+ - lib/runger_style/cops/default/multiline_hash_value_indentation.rb
76
+ - lib/runger_style/cops/default/multiline_method_arguments_line_breaks.rb
77
+ - lib/runger_style/cops/default/require_all_custom_cops.rb
78
+ - lib/runger_style/cops/default/require_all_monkeypatches.rb
77
79
  - lib/runger_style/version.rb
78
80
  - rulesets/capybara.yml
79
81
  - rulesets/default.yml
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Dir[File.expand_path('../monkeypatches/**/*.rb', __dir__)].each do |file|
4
- require file
5
- end