Skip to content

XcodeBuildToolPlugin#5

Merged
fummicc1 merged 13 commits intomainfrom
feature/xcode-build-tool-plugin
Sep 12, 2025
Merged

XcodeBuildToolPlugin#5
fummicc1 merged 13 commits intomainfrom
feature/xcode-build-tool-plugin

Conversation

@fummicc1
Copy link
Owner

@fummicc1 fummicc1 commented Aug 27, 2025

Overview

Create XcodeBuildToolPlugin running swift-complexity CLI.

Demo Screenshot

Screenshot 2025-09-13 at 0 26 41

Type of Change

Please check all that apply:

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • 🧪 Test improvements
  • ⚡ Performance improvements
  • 🔨 Build/CI improvements
  • 🌍 Cross-platform compatibility changes

Related Issues

Closes #4
Related to #(issue number)

Changes Made

Core Changes

Tests

Documentation

Testing

Test Plan

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Complexity analysis on self passes

Test Commands

# Commands used to test this change
swift test
swift run swift-complexity Sources --threshold 15

Complexity Analysis

Self-Analysis Required

  • Complexity analysis run on changed files
  • No functions exceed threshold (15)
  • New complex code is justified and documented

Run swift-complexity on your changes:

# Analyze changed files for complexity
swift run swift-complexity [changed-files] --threshold 15 --format text

# For comprehensive analysis
swift run swift-complexity Sources --threshold 15 --recursive --format json

Results: (paste results here or indicate no high-complexity functions added)

Justification for complex functions: (if any functions exceed threshold)

Cross-Platform Compatibility

Platform Testing

  • Changes tested on macOS (Apple Silicon)
  • Changes tested on macOS (Intel)
  • Changes tested on Linux (Ubuntu 22.04+)
  • Platform-specific code properly conditionally compiled

Platform Considerations

  • No platform-specific dependencies added
  • Linux compatibility maintained
  • macOS-specific features properly isolated (e.g., swift-format)

Performance Impact

  • No performance impact
  • Performance improved
  • Performance regression (with justification)

Details: (if applicable)

Breaking Changes

  • No breaking changes
  • Breaking changes (describe below)

Breaking Changes Description: (if applicable)

Screenshots/Output

(If applicable, add screenshots or example output)

Checklist

Code Quality

  • Code follows the project's style guidelines
  • Self-review of code completed
  • Code is self-documenting with clear variable/function names
  • Complex logic is commented where necessary

Testing

  • Tests added for new functionality
  • Existing tests updated as needed
  • All tests pass locally
  • Edge cases considered and tested

Documentation

  • Documentation updated (if needed)
  • README updated (if needed)
  • CLAUDE.md updated (if architecture changes)
  • API documentation updated (if applicable)

Dependencies

  • No new dependencies added
  • New dependencies justified and documented
  • Package.swift updated appropriately
  • Cross-platform compatibility verified for new dependencies

CI/CD

  • CI pipeline passes (macOS & Linux)
  • No new linting warnings introduced
  • Code formatting validation passes (swift-format on macOS)
  • Documentation linting passes (markdownlint)
  • Self-complexity analysis in CI passes
  • Release workflow compatibility maintained (if applicable)

Additional Notes

(Any additional information that reviewers should know)

fummicc1 and others added 11 commits August 28, 2025 04:43
Use specific keyword positions (funcKeyword, initKeyword, etc.) instead
of entire node positions and use positionAfterSkippingLeadingTrivia
to get more accurate source locations for Xcode diagnostics.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update all SyntaxVisitor implementations to use sourceAccurate mode
for more precise source location tracking. This ensures accurate
line numbers in diagnostic output.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add 'xcode' output format that generates Xcode-compatible diagnostics
with proper warning/error severity based on complexity thresholds.
This enables direct IDE integration for complexity warnings.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Create separate plugin package under Examples/ to avoid circular
dependencies. The plugin uses buildCommand instead of prebuildCommand
to work with source-built executables.

- Supports both SPM and Xcode project integration
- Uses environment variable SWIFT_COMPLEXITY_THRESHOLD for configuration
- Outputs diagnostics in Xcode format for IDE integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add example iOS app demonstrating Build Tool Plugin integration with
sample complex code for testing complexity analysis. The example
includes various complexity levels for testing thresholds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Rename executable product from 'swift-complexity' to 'SwiftComplexityCLI'
  to match target name and improve plugin compatibility
- Add iOS platform support (.iOS(.v13)) for broader compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add .build/ to .gitignore for cleaner repository
- Add SwiftComplexityCLI launch configurations to VSCode settings
- Update README to mention plugin architecture in package structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Move SwiftComplexityPlugin from Examples/SwiftComplexityPlugin to Plugins/SwiftComplexityPlugin
and integrate it into main Package.swift. This provides a more appropriate structure
where users can access both CLI and plugin from a single dependency.

Changes:
- Remove Examples/SwiftComplexityPlugin package
- Add plugin target to main Package.swift
- Move plugin implementation to Plugins/SwiftComplexityPlugin/
- Update test to include new 'xcode' output format
- Update example project to reference main package plugin
- Add complexity calculation comments to example code

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@fummicc1 fummicc1 force-pushed the feature/xcode-build-tool-plugin branch from e802c36 to dfbc6a1 Compare September 12, 2025 15:25
@github-actions
Copy link

🔍 Complexity Analysis Results

✅ All functions are below the complexity threshold of 15.

This analysis was performed by swift-complexity itself.

@fummicc1 fummicc1 marked this pull request as ready for review September 12, 2025 15:41
@github-actions
Copy link

📊 PR Analysis

Type Count
Swift files 15
Test files 5
Documentation 3
Configuration 6

📝 Large PR: Consider breaking this into smaller, focused PRs.


Automated analysis by swift-complexity CI

1 similar comment
@github-actions
Copy link

📊 PR Analysis

Type Count
Swift files 15
Test files 5
Documentation 3
Configuration 6

📝 Large PR: Consider breaking this into smaller, focused PRs.


Automated analysis by swift-complexity CI

@fummicc1 fummicc1 force-pushed the feature/xcode-build-tool-plugin branch from e01d195 to 0e8ab63 Compare September 12, 2025 15:53
@github-actions
Copy link

📊 PR Analysis

Type Count
Swift files 15
Test files 5
Documentation 3
Configuration 6

📝 Large PR: Consider breaking this into smaller, focused PRs.


Automated analysis by swift-complexity CI

@github-actions
Copy link

🔍 Complexity Analysis Results

✅ All functions are below the complexity threshold of 15.

This analysis was performed by swift-complexity itself.

@fummicc1 fummicc1 force-pushed the feature/xcode-build-tool-plugin branch from 0e8ab63 to ef4aee8 Compare September 12, 2025 16:21
@github-actions
Copy link

📊 PR Analysis

Type Count
Swift files 15
Test files 5
Documentation 3
Configuration 6

📝 Large PR: Consider breaking this into smaller, focused PRs.


Automated analysis by swift-complexity CI

@github-actions
Copy link

🔍 Complexity Analysis Results

✅ All functions are below the complexity threshold of 15.

This analysis was performed by swift-complexity itself.

@github-actions
Copy link

📊 PR Analysis

Type Count
Swift files 15
Test files 5
Documentation 3
Configuration 6

📝 Large PR: Consider breaking this into smaller, focused PRs.


Automated analysis by swift-complexity CI

@fummicc1 fummicc1 merged commit 089cd80 into main Sep 12, 2025
6 checks passed
@fummicc1 fummicc1 deleted the feature/xcode-build-tool-plugin branch September 12, 2025 16:33
@github-actions
Copy link

🔍 Complexity Analysis Results

✅ All functions are below the complexity threshold of 15.

This analysis was performed by swift-complexity itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: XcodeBuildToolPlugin

1 participant