Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 8 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,17 @@ jobs:
lint:
name: Lint
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

# SwiftLint temporarily disabled
# - name: Install SwiftLint
# run: |
# brew install swiftlint
#
# - name: Run SwiftLint
# run: |
# swiftlint lint

- name: Check Package Format
run: swift package resolve


- name: Install SwiftLint
run: brew install swiftlint

- name: Run SwiftLint
run: swiftlint lint

- name: Verify Package Structure
run: |
swift package dump-package > /dev/null
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ docs/*
# SwiftLint
.swiftlintcache

# Claude Code worktrees
.claude/worktrees/

# Local documentation (not for public repository)
MEDIUM_ARTICLE.md
docs-test/
Expand Down
167 changes: 16 additions & 151 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,161 +1,26 @@
# SwiftLint Configuration for AGUISwift
# https://github.com/realm/SwiftLint

# Paths to include
included:
- Sources
- Tests
- Package.swift

# Paths to exclude
excluded:
- .build
- Package.swift

# Enabled rules beyond defaults
opt_in_rules:
- array_init
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- empty_collection_literal
- empty_count
- empty_string
- explicit_init
- extension_access_modifier
- fallthrough
- fatal_error_message
- file_header
- first_where
- flatmap_over_map_reduce
- identical_operands
- implicit_return
- joined_default_parameter
- last_where
- literal_expression_end_indentation
- lower_acl_than_parent
- modifier_order
- multiline_arguments
- multiline_parameters
- operator_usage_whitespace
- overridden_super_call
- prefer_self_in_static_references
- prefer_self_type_over_type_of_self
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- toggle_bool
- trailing_closure
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
- yoda_condition

# Disabled rules
disabled_rules:
- trailing_comma # Project uses no trailing commas
- todo # Allow TODO comments during development
- opening_brace # SwiftFormat handles this
- extension_access_modifier # Existing code doesn't use this pattern
- prefer_self_in_static_references # Would require extensive refactoring
- trailing_closure # Conflicts with existing code style
- trailing_whitespace # SwiftFormat will handle this - temporarily disabled
- static_over_final_class # URLProtocol subclasses require class methods for overrides

# Rule configurations
line_length:
warning: 120
error: 150
ignores_comments: true
ignores_urls: true
ignores_function_declarations: true

file_length:
warning: 600
error: 1000
ignore_comment_only_lines: true

type_body_length:
warning: 500
error: 700

function_body_length:
warning: 80
error: 150

function_parameter_count:
warning: 6
error: 8

type_name:
min_length: 2
max_length: 50
validates_start_with_lowercase: false

identifier_name:
min_length:
warning: 2
error: 1
max_length:
warning: 50
error: 60
excluded:
- id
- i
- j
- x
- y
- z
- v
- n

nesting:
type_level: 2
function_level: 3

cyclomatic_complexity:
warning: 20
error: 30

large_tuple:
warning: 3
error: 4

# Force cast and force try (warnings only, not errors)
# Disable in tests since we're testing known types
force_cast:
severity: warning
force_try: warning

# File header format (MIT License)
file_header:
required_pattern: |
\/\*\s*\n \* MIT License\s*\n \*\s*\n \* Copyright \(c\) 2025 Perfect Aduh
- Tests

# Modifier order (Swift 6 conventions - matches SwiftFormat)
# Valid groups: override, isolation, acl, setterACL, dynamic, mutators, lazy, final, required, convenience, typeMethods, owned
modifier_order:
preferred_modifier_order:
- override
- isolation
- acl
- setterACL
- dynamic
- mutators
- lazy
- final
- required
- convenience
- typeMethods
- owned
only_rules:
- force_cast
- force_try
- force_unwrapping
- custom_rules
- large_tuple

# Custom rules
custom_rules:
no_print_in_production:
name: "No print statements"
regex: '^\s*print\s*\('
message: "Avoid print() in production code. Use proper logging instead."
severity: warning
no_assume_isolated:
name: "No assumeIsolated"
regex: "\\b(?:MainActor|[A-Za-z_][A-Za-z0-9_]*)\\.assumeIsolated\\s*(?:\\(|\\{)"
match_kinds:
- identifier
message: "Do not use assumeIsolated. Use explicit actor isolation or restructure the code to stay within structured concurrency."
severity: error

large_tuple:
warning_length: 3
24 changes: 1 addition & 23 deletions Examples/ChatApp/Sources/A2UI/A2UIComponent.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
/*
* MIT License
*
* Copyright (c) 2025 Perfect Aduh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Copyright (c) 2025 Perfect Aduh. MIT License. See LICENSE for details.

import Foundation

Expand Down
24 changes: 1 addition & 23 deletions Examples/ChatApp/Sources/A2UI/A2UISurfaceStateManager.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
/*
* MIT License
*
* Copyright (c) 2025 Perfect Aduh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Copyright (c) 2025 Perfect Aduh. MIT License. See LICENSE for details.

import AGUIClient
import AGUICore
Expand Down
24 changes: 1 addition & 23 deletions Examples/ChatApp/Sources/App/ChatAppApp.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
/*
* MIT License
*
* Copyright (c) 2025 Perfect Aduh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Copyright (c) 2025 Perfect Aduh. MIT License. See LICENSE for details.

import SwiftUI

Expand Down
24 changes: 1 addition & 23 deletions Examples/ChatApp/Sources/ClawgUI/ClawgUIDetector.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
/*
* MIT License
*
* Copyright (c) 2025 Perfect Aduh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Copyright (c) 2025 Perfect Aduh. MIT License. See LICENSE for details.

import Foundation

Expand Down
24 changes: 1 addition & 23 deletions Examples/ChatApp/Sources/ClawgUI/ClawgUIPairingManager.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
/*
* MIT License
*
* Copyright (c) 2025 Perfect Aduh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Copyright (c) 2025 Perfect Aduh. MIT License. See LICENSE for details.

import Foundation

Expand Down
24 changes: 1 addition & 23 deletions Examples/ChatApp/Sources/ClawgUI/ClawgUIPairingState.swift
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
/*
* MIT License
*
* Copyright (c) 2025 Perfect Aduh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Copyright (c) 2025 Perfect Aduh. MIT License. See LICENSE for details.

import Foundation

Expand Down
Loading
Loading