{"id":43302594,"url":"https://github.com/ericodx/swift-structure","last_synced_at":"2026-02-01T20:01:11.071Z","repository":{"id":335406502,"uuid":"1135909165","full_name":"ericodx/swift-structure","owner":"ericodx","description":"Organize the internal structure of Swift types without rewriting code.","archived":false,"fork":false,"pushed_at":"2026-01-30T17:15:41.000Z","size":478,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-30T17:41:33.874Z","etag":null,"topics":["developer-tools","static-analysis","swift","swift-cli","swift-syntax"],"latest_commit_sha":null,"homepage":"https://github.com/deploy-on-friday/swift-structure?tab=readme-ov-file#README","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericodx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":"Docs/GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-16T19:08:30.000Z","updated_at":"2026-01-30T02:27:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ericodx/swift-structure","commit_stats":null,"previous_names":["ericodx/swift-structure"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ericodx/swift-structure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericodx","download_url":"https://codeload.github.com/ericodx/swift-structure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-structure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28988407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T18:17:03.387Z","status":"ssl_error","status_checked_at":"2026-02-01T18:16:57.287Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","static-analysis","swift","swift-cli","swift-syntax"],"created_at":"2026-02-01T20:01:10.068Z","updated_at":"2026-02-01T20:01:11.066Z","avatar_url":"https://github.com/ericodx.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Structure\n\n![Platform](https://img.shields.io/badge/platform-macOS-orange?logo=apple\u0026logoColor=white)\n![Swift](https://img.shields.io/badge/swift-6.0+-orange?logo=swift\u0026logoColor=white)\n[![CI](https://github.com/ericodx/swift-structure/actions/workflows/main-analysis.yml/badge.svg)](https://github.com/ericodx/swift-structure/actions/workflows/main-analysis.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=deploy-on-friday-swift-structure\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=deploy-on-friday-swift-structure)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=deploy-on-friday-swift-structure\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=deploy-on-friday-swift-structure)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=deploy-on-friday-swift-structure\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=deploy-on-friday-swift-structure)\n\n**Organize the internal structure of Swift types without rewriting code.**\n\nSwift Structure is an AST-based CLI tool built on SwiftSyntax.\n\nIt focuses exclusively on **structural organization** of Swift types — not formatting, not syntax rewriting, and not templates.\n\n---\n\n## What Swift Structure Does\n\n- Reorders and groups members **within the same declaration scope**\n- Reorders members inside individual `extension` blocks only\n- Treats `extension` blocks as hard structural boundaries\n- Never moves members across extensions or files\n- Preserves comments, trivia, and original formatting\n- Produces deterministic output\n\n---\n\n## Installation\n\nThe recommended way to install Swift Structure is via Homebrew:\n\n```bash\nbrew tap ericodx/homebrew-tap\nbrew install swift-structure\n```\n\n### Other Installation Methods\n\n**[View Complete Installation Guide](Docs/INSTALLATION.md)**\n\n- Manual build from source\n- Direct download of pre-compiled binaries\n- Troubleshooting and updates\n\n---\n\n## Usage\n\n### Check files for ordering issues\n\n```bash\n# Single file\nswift-structure check Sources/App/MyFile.swift\n\n# All .swift files recursively (zsh)\nswift-structure check Sources/**/*.swift\n\n# All .swift files recursively (bash/portable)\nswift-structure check $(find Sources -name \"*.swift\")\n\n# Quiet mode (CI-friendly, only shows files needing changes)\nswift-structure check --quiet $(find Sources -name \"*.swift\")\n```\n\nExit codes:\n- `0` - All files are correctly ordered\n- `1` - One or more files need reordering\n\n### Fix files\n\n```bash\n# Single file\nswift-structure fix Sources/App/MyFile.swift\n\n# All .swift files recursively\nswift-structure fix $(find Sources -name \"*.swift\")\n\n# Preview changes without modifying files\nswift-structure fix --dry-run $(find Sources -name \"*.swift\")\n\n# Quiet mode (only show summary)\nswift-structure fix --quiet $(find Sources -name \"*.swift\")\n```\n\n---\n\n## Quick Integration\n\n### Xcode Build Phase\n\n```bash\nif which swift-structure \u003e /dev/null; then\n    swift-structure check --quiet $(find \"${SRCROOT}/Sources\" -name \"*.swift\")\nfi\n```\n\n### GitHub Actions\n\n```yaml\n- name: Check structure\n  run: swift-structure check Sources/**/*.swift\n```\n\n### pre-commit\n\n```yaml\nhooks:\n  - id: swift-structure\n    entry: swift-structure check --quiet\n    files: \\.swift$\n```\n\nSee [Xcode Integration](Docs/Examples/xcode-integration.md) and [CI Integration](Docs/Examples/ci-integration.md) for complete guides.\n\n---\n\n## Configuration\n\nSwift Structure uses **`.swift-structure.yaml`** for configuration.\n\n```bash\n# Initialize configuration file\nswift-structure init\n```\n\nSee [Configuration Reference](Docs/CONFIGURATION.md) for complete documentation.\n\n### Example Configurations\n\n| Example | Use Case |\n|---------|----------|\n| [minimal.yaml](Docs/Examples/minimal.yaml) | Basic ordering |\n| [swiftui.yaml](Docs/Examples/swiftui.yaml) | SwiftUI with property wrappers |\n| [uikit.yaml](Docs/Examples/uikit.yaml) | UIKit with lifecycle methods |\n| [visibility-focused.yaml](Docs/Examples/visibility-focused.yaml) | Libraries and frameworks |\n\n---\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [Architecture](Docs/Architecture/README.md) | System design and patterns |\n| [CI/CD](Docs/CI/README.md) | GitHub Actions workflows and automation |\n| [CLI Reference](Docs/CLI/README.md) | Commands and implementation |\n| [Configuration](Docs/CONFIGURATION.md) | YAML schema and options |\n| [Examples](Docs/Examples/README.md) | Configuration examples |\n\n### Integration Guides\n\n| Guide | Description |\n|-------|-------------|\n| [Xcode Integration](Docs/Examples/xcode-integration.md) | Build phases, hooks, behaviors |\n| [CI Integration](Docs/Examples/ci-integration.md) | GitHub Actions, GitLab CI, etc. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericodx%2Fswift-structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericodx%2Fswift-structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericodx%2Fswift-structure/lists"}