hubbado-style 1.9.0 → 1.10.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: 0c970850905b913bd64714ba454f9dcb9f2d4e70f49db94fe4ce0811c7aa3558
4
- data.tar.gz: 5307e88996f9508322265567ab111e09c2a27cbbf1b0f5b8dbe2003200295d83
3
+ metadata.gz: aef7908b85f5ddac6f278227fb16d6c6f5bdc094049afbdb256944fa147ec0fc
4
+ data.tar.gz: '09856970e6e6c46e15862af65b11febdf6d2539c88b1008b396666a2c2ffc4d5'
5
5
  SHA512:
6
- metadata.gz: 3a81b42b231785bab3671f0611d2e37a247936c1cab7b390b240600e41d58289e9efc2152ea78656c6f57d120704259155836bd579cc8235d9d9ce855cd84454
7
- data.tar.gz: af789ffa182ef92bf38613122720e49118fba4c95dd793300b87e8146ad68a9fe265b3ca8d246e217d3b4eda902a02fc4cf3966551be3a342a53073473a52617
6
+ metadata.gz: 0dd975fa210b2f6ef3758871520510845aaa0c8e8f62943e031224a03fbe8b86059b671380469b791ea1d3b9afa29328b1195abd732c1c07595b2602a29c5b82
7
+ data.tar.gz: 6fecac2a901935077870c08c417f0f479c6cf93fd48ff2d7ec0f072e351438be3e4e843e3b89ad488e4b3e00c1309fc2b86bf1812aa99e5ef80899945b3a844a
data/ChangeLog.md CHANGED
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ # [1.10.0 - 2026-11-20]
8
+ ## Changed
9
+ - Hubbado/MultilineMethodArgumentLineBreaks replaces
10
+ Layout/MultilineMethodArgumentLineBreaks. It counts each keyword argument as
11
+ one argument also where a block argument such as `&stream` follows the
12
+ keywords, which RuboCop's cop does not
13
+
14
+ ## Migration
15
+ - Rename a `.rubocop.yml` override or a disable of
16
+ Layout/MultilineMethodArgumentLineBreaks to
17
+ Hubbado/MultilineMethodArgumentLineBreaks
18
+ - Run `rubocop -a --only Hubbado/MultilineMethodArgumentLineBreaks`. Every
19
+ offence can be corrected automatically
20
+
7
21
  # [1.9.0 - 2026-11-20]
8
22
  ## Changed
9
23
  - Layout/FirstArrayElementLineBreak, Layout/MultilineArrayLineBreaks,
data/default.yml CHANGED
@@ -157,8 +157,7 @@ Layout/MultilineMethodCallIndentation:
157
157
  IndentationWidth: 2
158
158
 
159
159
  Layout/MultilineMethodArgumentLineBreaks:
160
- Enabled: true
161
- AllowMultilineFinalElement: true
160
+ Enabled: false
162
161
 
163
162
  Layout/MultilineMethodParameterLineBreaks:
164
163
  Enabled: true
@@ -186,6 +185,10 @@ Lint/ConstantDefinitionInBlock:
186
185
  Lint/UnusedMethodArgument:
187
186
  Enabled: false
188
187
 
188
+ Hubbado/MultilineMethodArgumentLineBreaks:
189
+ Enabled: true
190
+ AllowMultilineFinalElement: true
191
+
189
192
  Hubbado/UnusedMethodArgument:
190
193
  Enabled: true
191
194
  Severity: warning
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "hubbado-style"
3
- s.version = "1.9.0"
3
+ s.version = "1.10.0"
4
4
  s.summary = "Hubbado style guides and shared style configs."
5
5
 
6
6
  s.authors = ["Hubbado Devs"]
@@ -0,0 +1,20 @@
1
+ # Puts each argument of a multi-line call on its own line, counting each keyword argument as one,
2
+ # also where a block argument such as `&stream` follows the keywords
3
+ module RuboCop
4
+ module Cop
5
+ module Hubbado
6
+ class MultilineMethodArgumentLineBreaks < Layout::MultilineMethodArgumentLineBreaks
7
+ def on_send(node)
8
+ return if node.method?(:[]=)
9
+
10
+ arguments = node.arguments.flat_map do |argument|
11
+ argument.hash_type? && !argument.braces? ? argument.children : [argument]
12
+ end
13
+
14
+ check_line_breaks(node, arguments, ignore_last: ignore_last_element?)
15
+ end
16
+ alias on_csend on_send
17
+ end
18
+ end
19
+ end
20
+ end
data/lib/hubbado/style.rb CHANGED
@@ -2,3 +2,4 @@
2
2
  require "rubocop"
3
3
 
4
4
  require "hubbado/style/unused_method_argument"
5
+ require "hubbado/style/multiline_method_argument_line_breaks"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubbado-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hubbado Devs
@@ -77,6 +77,7 @@ files:
77
77
  - default.yml
78
78
  - hubbado-style.gemspec
79
79
  - lib/hubbado/style.rb
80
+ - lib/hubbado/style/multiline_method_argument_line_breaks.rb
80
81
  - lib/hubbado/style/unused_method_argument.rb
81
82
  homepage: https://github.com/hubbado/hubbado-style
82
83
  licenses: