Skip to content

Commit 857b515

Browse files
jacksonpiresclaude
andauthored
[Bug Fix] Fix gem linter: remove redundant keyword_init: true (#426)
* [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> * [Bug Fix] Remove redundant keyword_init: true in docs app Structs Same Style/RedundantStructKeywordInit drift failing the Docs (Rails) linter. Drop the redundant `keyword_init: true` from the six sample Structs in the docs app; keyword instantiation still works on Ruby 3.2+. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent dea0047 commit 857b515

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

docs/app/components/themes/grid/repo_tabs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Components
44
module Themes
55
module Grid
66
class RepoTabs < Components::Base
7-
Repo = Struct.new(:github_url, :name, :stars, :version, keyword_init: true)
7+
Repo = Struct.new(:github_url, :name, :stars, :version)
88

99
def view_template
1010
Tabs(default_value: "overview", class: "w-full") do

docs/app/components/themes/grid/table.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Components
44
module Themes
55
module Grid
66
class Table < Components::Base
7-
User = Struct.new(:avatar_url, :name, :username, :commits, :github_url, keyword_init: true)
7+
User = Struct.new(:avatar_url, :name, :username, :commits, :github_url)
88

99
# def view_template
1010
# render RubyUI::Card.new(class: "p-6") do

docs/app/views/docs/data_table.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
def view_template
77
@rows = [

docs/app/views/docs/table.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"

docs/app/views/docs/tabs.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"

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)