runger_style 4.1.0 → 4.2.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: 95f653d7a5d15cdfd65c797f384831bb510d0601a53889fe75a478a4400fd7ec
4
- data.tar.gz: 46827a79b5f5eb45f3485215ddcaf071c8729f1282e86ad9ca57ac9edd858986
3
+ metadata.gz: da6291e7956c095b8e8f891f07c63879ca8691bfedebdc27ec44bf83b1429691
4
+ data.tar.gz: 5e772363e0dd0d10e33fd1b0fd1c249b9e0a37212dba4cedd45aeb06be7cf05e
5
5
  SHA512:
6
- metadata.gz: 7dd0a6cbb56b2611b2f12117e319de0d637889d985e0715997856bee2a13c9ac14382ce49a544cdfb1344ce7c93644e724cd92ca95ed83345dc46de9f8760201
7
- data.tar.gz: 6dc7da33737bddb7bef0eaf46b03071cb010dc35deb53c7b23debec1015e6e00080b5187e8393646cd9afda4ae7405171e160e2467e217bb8e9022c0a0dbd67e
6
+ metadata.gz: 16c79aa8c9a343c321d0bd280d5d757755bff6103bdcbd6267157f1617c53d5ceba66bcc7a910b913c5f76872ba083dabbabfba1f6b9c1d671d79ca39c705a43
7
+ data.tar.gz: b0809a24102e25b4557c8a7ff9c293b16dbdf46cff85b67e7da66c7e0f654ac15a7884105ace85be9d3d8df62958fddf7ead57d5b2a5338fbecd1cf9b800d45f
@@ -1,4 +1,4 @@
1
- name: Run RuboCop
1
+ name: Run RuboCop and RSpec
2
2
 
3
3
  on:
4
4
  pull_request:
@@ -23,6 +23,8 @@ jobs:
23
23
  bundle install --jobs 4 --retry 3
24
24
  - name: Run RuboCop
25
25
  run: bin/rubocop --format clang
26
+ - name: Run RSpec tests
27
+ run: bin/rspec --format progress
26
28
  - name: Ensure alpha version
27
29
  run: grep alpha $(find . -type f -name version.rb)
28
30
  - name: Ensure no git diff
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v4.2.0 (2025-01-27)
2
+ - Add `RungerStyle/MultilineMethodArgumentsLineBreaks` cop.
3
+
1
4
  ## v4.1.0 (2025-01-11)
2
5
  - Enable `Style/BlockDelimiters` (except for `expect` method)
3
6
 
data/Gemfile CHANGED
@@ -19,6 +19,7 @@ group :development do
19
19
  end
20
20
 
21
21
  group :test do
22
+ gem 'rspec'
22
23
  gem 'rubocop-capybara'
23
24
  gem 'rubocop-factory_bot'
24
25
  gem 'rubocop-rails'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- runger_style (4.1.0)
4
+ runger_style (4.2.0)
5
5
  prism (>= 0.24.0)
6
6
  rubocop (>= 1.68.0)
7
7
 
@@ -25,39 +25,57 @@ GEM
25
25
  base64 (0.2.0)
26
26
  benchmark (0.4.0)
27
27
  bigdecimal (3.1.9)
28
- concurrent-ruby (1.3.4)
29
- connection_pool (2.4.1)
28
+ concurrent-ruby (1.3.5)
29
+ connection_pool (2.5.0)
30
30
  date (3.4.1)
31
+ diff-lcs (1.5.1)
31
32
  drb (2.2.1)
32
- i18n (1.14.6)
33
+ i18n (1.14.7)
33
34
  concurrent-ruby (~> 1.0)
34
35
  io-console (0.8.0)
35
- irb (1.14.3)
36
+ irb (1.15.1)
37
+ pp (>= 0.6.0)
36
38
  rdoc (>= 4.0.0)
37
39
  reline (>= 0.4.2)
38
40
  json (2.9.1)
39
41
  language_server-protocol (3.17.0.3)
40
- logger (1.6.4)
42
+ logger (1.6.5)
41
43
  memo_wise (1.10.0)
42
44
  minitest (5.25.4)
43
45
  parallel (1.26.3)
44
- parser (3.3.6.0)
46
+ parser (3.3.7.0)
45
47
  ast (~> 2.4.1)
46
48
  racc
49
+ pp (0.6.2)
50
+ prettyprint
51
+ prettyprint (0.2.0)
47
52
  prism (1.3.0)
48
- psych (5.2.2)
53
+ psych (5.2.3)
49
54
  date
50
55
  stringio
51
56
  racc (1.8.1)
52
57
  rack (3.1.8)
53
58
  rainbow (3.1.1)
54
59
  rake (13.2.1)
55
- rdoc (6.10.0)
60
+ rdoc (6.11.0)
56
61
  psych (>= 4.0.0)
57
62
  regexp_parser (2.10.0)
58
63
  reline (0.6.0)
59
64
  io-console (~> 0.5)
60
- rubocop (1.69.2)
65
+ rspec (3.13.0)
66
+ rspec-core (~> 3.13.0)
67
+ rspec-expectations (~> 3.13.0)
68
+ rspec-mocks (~> 3.13.0)
69
+ rspec-core (3.13.2)
70
+ rspec-support (~> 3.13.0)
71
+ rspec-expectations (3.13.3)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.13.0)
74
+ rspec-mocks (3.13.2)
75
+ diff-lcs (>= 1.2.0, < 2.0)
76
+ rspec-support (~> 3.13.0)
77
+ rspec-support (3.13.2)
78
+ rubocop (1.71.0)
61
79
  json (~> 2.3)
62
80
  language_server-protocol (>= 3.17.0)
63
81
  parallel (~> 1.10)
@@ -73,23 +91,23 @@ GEM
73
91
  rubocop (~> 1.41)
74
92
  rubocop-factory_bot (2.26.1)
75
93
  rubocop (~> 1.61)
76
- rubocop-performance (1.23.0)
94
+ rubocop-performance (1.23.1)
77
95
  rubocop (>= 1.48.1, < 2.0)
78
96
  rubocop-ast (>= 1.31.1, < 2.0)
79
- rubocop-rails (2.28.0)
97
+ rubocop-rails (2.29.1)
80
98
  activesupport (>= 4.2.0)
81
99
  rack (>= 1.1)
82
100
  rubocop (>= 1.52.0, < 2.0)
83
101
  rubocop-ast (>= 1.31.1, < 2.0)
84
102
  rubocop-rake (0.6.0)
85
103
  rubocop (~> 1.0)
86
- rubocop-rspec (3.3.0)
104
+ rubocop-rspec (3.4.0)
87
105
  rubocop (~> 1.61)
88
106
  rubocop-rspec_rails (2.30.0)
89
107
  rubocop (~> 1.61)
90
108
  rubocop-rspec (~> 3, >= 3.0.1)
91
109
  ruby-progressbar (1.13.0)
92
- runger_release_assistant (0.13.0)
110
+ runger_release_assistant (0.14.0)
93
111
  activesupport (>= 6)
94
112
  memo_wise (>= 1.7)
95
113
  rainbow (>= 3.0)
@@ -99,7 +117,7 @@ GEM
99
117
  stringio (3.1.2)
100
118
  tzinfo (2.0.6)
101
119
  concurrent-ruby (~> 1.0)
102
- unicode-display_width (3.1.3)
120
+ unicode-display_width (3.1.4)
103
121
  unicode-emoji (~> 4.0, >= 4.0.4)
104
122
  unicode-emoji (4.0.4)
105
123
  uri (1.0.2)
@@ -111,6 +129,7 @@ DEPENDENCIES
111
129
  bundler
112
130
  irb
113
131
  rake
132
+ rspec
114
133
  rubocop
115
134
  rubocop-capybara
116
135
  rubocop-factory_bot
@@ -122,6 +141,63 @@ DEPENDENCIES
122
141
  runger_release_assistant
123
142
  runger_style!
124
143
 
144
+ CHECKSUMS
145
+ activesupport (8.0.1) sha256=fd5bc74641c24ac3541055c2879789198ff42adee3e39c2933289ba008912e37
146
+ ast (2.4.2) sha256=1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12
147
+ base64 (0.2.0) sha256=0f25e9b21a02a0cc0cea8ef92b2041035d39350946e8789c562b2d1a3da01507
148
+ benchmark (0.4.0) sha256=0f12f8c495545e3710c3e4f0480f63f06b4c842cc94cec7f33a956f5180e874a
149
+ bigdecimal (3.1.9) sha256=2ffc742031521ad69c2dfc815a98e426a230a3d22aeac1995826a75dabfad8cc
150
+ concurrent-ruby (1.3.5) sha256=813b3e37aca6df2a21a3b9f1d497f8cbab24a2b94cab325bffe65ee0f6cbebc6
151
+ connection_pool (2.5.0) sha256=233b92f8d38e038c1349ccea65dd3772727d669d6d2e71f9897c8bf5cd53ebfc
152
+ date (3.4.1) sha256=bf268e14ef7158009bfeaec40b5fa3c7271906e88b196d958a89d4b408abe64f
153
+ diff-lcs (1.5.1) sha256=273223dfb40685548436d32b4733aa67351769c7dea621da7d9dd4813e63ddfe
154
+ drb (2.2.1) sha256=e9d472bf785f558b96b25358bae115646da0dbfd45107ad858b0bc0d935cb340
155
+ i18n (1.14.7) sha256=ceba573f8138ff2c0915427f1fc5bdf4aa3ab8ae88c8ce255eb3ecf0a11a5d0f
156
+ io-console (0.8.0) sha256=cd6a9facbc69871d69b2cb8b926fc6ea7ef06f06e505e81a64f14a470fddefa2
157
+ irb (1.15.1) sha256=d9bca745ac4207a8b728a52b98b766ca909b86ff1a504bcde3d6f8c84faae890
158
+ json (2.9.1) sha256=d2bdef4644052fad91c1785d48263756fe32fcac08b96a20bb15840e96550d11
159
+ language_server-protocol (3.17.0.3) sha256=3d5c58c02f44a20d972957a9febe386d7e7468ab3900ce6bd2b563dd910c6b3f
160
+ logger (1.6.5) sha256=c3cfe56d01656490ddd103d38b8993d73d86296adebc5f58cefc9ec03741e56b
161
+ memo_wise (1.10.0) sha256=ae40ff8e7799697ff5d59d739b8766f76be22eba69c7c8468edb42ab83c94c3f
162
+ minitest (5.25.4) sha256=9cf2cae25ac4dfc90c988ebc3b917f53c054978b673273da1bd20bcb0778f947
163
+ parallel (1.26.3) sha256=d86babb7a2b814be9f4b81587bf0b6ce2da7d45969fab24d8ae4bf2bb4d4c7ef
164
+ parser (3.3.7.0) sha256=7449011771e3e7881297859b849de26a6f4fccd515bece9520a87e7d2116119b
165
+ pp (0.6.2) sha256=947ec3120c6f92195f8ee8aa25a7b2c5297bb106d83b41baa02983686577b6ff
166
+ prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
167
+ prism (1.3.0) sha256=b11620829831b1cb7e6c9b46c81ff8a6e36ccb3f888f164485eb7351f386273a
168
+ psych (5.2.3) sha256=84a54bb952d14604fea22d99938348814678782f58b12648fcdfa4d2fce859ee
169
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
170
+ rack (3.1.8) sha256=d3fbcbca43dc2b43c9c6d7dfbac01667ae58643c42cea10013d0da970218a1b1
171
+ rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
172
+ rake (13.2.1) sha256=46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d
173
+ rdoc (6.11.0) sha256=bec66fb9b019be64f7ba7d2cd2aecb283a3a01fef23a95b33e2349c6d1aa0040
174
+ regexp_parser (2.10.0) sha256=cb6f0ddde88772cd64bff1dbbf68df66d376043fe2e66a9ef77fcb1b0c548c61
175
+ reline (0.6.0) sha256=57620375dcbe56ec09bac7192bfb7460c716bbf0054dc94345ecaa5438e539d2
176
+ rspec (3.13.0) sha256=d490914ac1d5a5a64a0e1400c1d54ddd2a501324d703b8cfe83f458337bab993
177
+ rspec-core (3.13.2) sha256=94fbda6e4738e478f1c7532b7cc241272fcdc8b9eac03a97338b1122e4573300
178
+ rspec-expectations (3.13.3) sha256=0e6b5af59b900147698ea0ff80456c4f2e69cac4394fbd392fbd1ca561f66c58
179
+ rspec-mocks (3.13.2) sha256=2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef
180
+ rspec-support (3.13.2) sha256=cea3a2463fd9b84b9dcc9685efd80ea701aa8f7b3decb3b3ce795ed67737dbec
181
+ rubocop (1.71.0) sha256=e19679efd447346ac476122313d3788ae23c38214790bcf660e984c747608bf0
182
+ rubocop-ast (1.37.0) sha256=9513ac88aaf113d04b52912533ffe46475de1362d4aa41141b51b2455827c080
183
+ rubocop-capybara (2.21.0) sha256=5d264efdd8b6c7081a3d4889decf1451a1cfaaec204d81534e236bc825b280ab
184
+ rubocop-factory_bot (2.26.1) sha256=8de13cd4edcee5ca800f255188167ecef8dbfc3d1fae9f15734e9d2e755392aa
185
+ rubocop-performance (1.23.1) sha256=f22f86a795f5e6a6180aac2c6fc172534b173a068d6ed3396d6460523e051b82
186
+ rubocop-rails (2.29.1) sha256=41c2fcf48d5d62f4a5f574d5f1c97bbaf4cba88ee367936c98b3422d047b17aa
187
+ rubocop-rake (0.6.0) sha256=56b6f22189af4b33d4f4e490a555c09f1281b02f4d48c3a61f6e8fe5f401d8db
188
+ rubocop-rspec (3.4.0) sha256=8721c13b6a8c9530a7ac481cea9423022f946fcf72428bda8289f8b57e4d4885
189
+ rubocop-rspec_rails (2.30.0) sha256=888112e83f9d7ef7ad2397e9d69a0b9614a4bae24f072c399804a180f80c4c46
190
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
191
+ runger_release_assistant (0.14.0) sha256=7abc5eb1e0f63d8d611691bc21698d2b3b8f148a5f47cacd8dd32c21d16ee9be
192
+ runger_style (4.2.0)
193
+ securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
194
+ slop (4.10.1) sha256=844322b5ffcf17ed4815fdb173b04a20dd82b4fd93e3744c88c8fafea696d9c7
195
+ stringio (3.1.2) sha256=204f1828f85cdb39d57cac4abc6dc44b04505a223f131587f2e20ae3729ba131
196
+ tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
197
+ unicode-display_width (3.1.4) sha256=8caf2af1c0f2f07ec89ef9e18c7d88c2790e217c482bfc78aaa65eadd5415ac1
198
+ unicode-emoji (4.0.4) sha256=2c2c4ef7f353e5809497126285a50b23056cc6e61b64433764a35eff6c36532a
199
+ uri (1.0.2) sha256=b303504ceb7e5905771fa7fa14b649652fa949df18b5880d69cfb12494791e27
200
+
125
201
  RUBY VERSION
126
202
  ruby 3.4.1p0
127
203
 
@@ -4,5 +4,6 @@ set -euo pipefail # exit on any error, don't allow undefined variables, pipes do
4
4
 
5
5
  lint gitleaks
6
6
 
7
+ background-and-notify lint newlines
7
8
  background-and-notify lint rubocop
8
9
  background-and-notify lint shellcheck
data/bin/rspec ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
+
13
+ bundle_binstub = File.expand_path("bundle", __dir__)
14
+
15
+ if File.file?(bundle_binstub)
16
+ if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17
+ load(bundle_binstub)
18
+ else
19
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
+ end
22
+ end
23
+
24
+ require "rubygems"
25
+ require "bundler/setup"
26
+
27
+ load Gem.bin_path("rspec-core", "rspec")
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RungerStyle::MultilineMethodArgumentsLineBreaks < RuboCop::Cop::Base
4
+ extend RuboCop::Cop::AutoCorrector
5
+ include RuboCop::Cop::RangeHelp
6
+
7
+ MSG = 'Each argument in a multi-line method call must start on a separate line.'
8
+
9
+ def on_send(node)
10
+ return unless node.multiline?
11
+ return if node.arguments.size <= 1
12
+
13
+ node.arguments.each_cons(2) do |arg1, arg2|
14
+ next unless same_line?(arg1, arg2)
15
+
16
+ separator = separator_range(arg1, arg2)
17
+
18
+ add_offense(separator, message: MSG) do |corrector|
19
+ base_indent = base_indentation(arg1)
20
+ replacement = ",\n#{base_indent}"
21
+ corrector.replace(separator, replacement)
22
+ end
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ def same_line?(arg1, arg2)
29
+ arg1.source_range.last_line == arg2.source_range.first_line
30
+ end
31
+
32
+ def base_indentation(arg)
33
+ arg.source_range.source_line[/^\s*/]
34
+ end
35
+
36
+ def separator_range(arg1, arg2)
37
+ end_pos = arg1.source_range.end.end_pos
38
+ begin_pos = arg2.source_range.begin.begin_pos
39
+ range_between(end_pos, begin_pos)
40
+ end
41
+ 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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RungerStyle
4
- VERSION = '4.1.0'
4
+ VERSION = '4.2.0'
5
5
  end
data/lib/runger_style.rb CHANGED
@@ -4,4 +4,5 @@ require 'rubocop'
4
4
 
5
5
  module RungerStyle ; end
6
6
 
7
+ require 'runger_style/cops/require_all_custom_cops'
7
8
  require 'runger_style/version'
data/rulesets/default.yml CHANGED
@@ -1,3 +1,6 @@
1
+ require:
2
+ - ../lib/runger_style/cops/require_all_custom_cops.rb
3
+
1
4
  AllCops:
2
5
  EnabledByDefault: true
3
6
  ParserEngine: parser_prism
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runger_style
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-12 00:00:00.000000000 Z
10
+ date: 2025-01-27 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: prism
@@ -48,6 +48,7 @@ files:
48
48
  - ".github/workflows/ruby.yml"
49
49
  - ".gitignore"
50
50
  - ".release_assistant.yml"
51
+ - ".rspec"
51
52
  - ".rubocop.yml"
52
53
  - ".ruby-version"
53
54
  - ".runger-config.yml"
@@ -62,8 +63,11 @@ files:
62
63
  - bin/console
63
64
  - bin/githooks/pre-push
64
65
  - bin/release
66
+ - bin/rspec
65
67
  - bin/rubocop
66
68
  - lib/runger_style.rb
69
+ - lib/runger_style/cops/multiline_method_arguments_line_breaks.rb
70
+ - lib/runger_style/cops/require_all_custom_cops.rb
67
71
  - lib/runger_style/version.rb
68
72
  - rulesets/capybara.yml
69
73
  - rulesets/default.yml