Skip to content

Commit ba8d218

Browse files
jacksonpiresclaude
andcommitted
[Bug Fix] Remove redundant keyword_init: true in docs Structs
Standard's Style/RedundantStructKeywordInit flags `keyword_init: true` as redundant on Ruby 3.2+ (where Struct accepts both positional and keyword args), failing the gem linter on main. Drop it from the three *_docs.rb sample Structs; keyword instantiation still works on the supported Ruby (>= 3.2). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5a78514 commit ba8d218

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

gem/lib/ruby_ui/data_table/data_table_docs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class Views::Docs::DataTable < Views::Base
4-
Row = Struct.new(:id, :name, :email, :salary, :status, keyword_init: true)
4+
Row = Struct.new(:id, :name, :email, :salary, :status)
55

66
SAMPLE_ROWS = [
77
Row.new(id: 1, name: "Alice", email: "alice@example.com", salary: 90_000, status: "Active"),

gem/lib/ruby_ui/table/table_docs.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# frozen_string_literal: true
22

33
class Views::Docs::Table < Views::Base
4-
Invoice = Struct.new(:identifier, :status, :method, :amount, keyword_init: true)
5-
User = Struct.new(:avatar_url, :name, :username, :commits, :github_url, keyword_init: true)
4+
Invoice = Struct.new(:identifier, :status, :method, :amount)
5+
User = Struct.new(:avatar_url, :name, :username, :commits, :github_url)
66

77
def view_template
88
component = "Table"

gem/lib/ruby_ui/tabs/tabs_docs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class Views::Docs::Tabs < Views::Base
4-
Repo = Struct.new(:github_url, :name, :stars, :version, keyword_init: true)
4+
Repo = Struct.new(:github_url, :name, :stars, :version)
55

66
def view_template
77
component = "Tabs"

0 commit comments

Comments
 (0)