{"id":47879860,"url":"https://github.com/ericodx/swift-marshal","last_synced_at":"2026-04-04T01:42:25.703Z","repository":{"id":348032928,"uuid":"1182479292","full_name":"ericodx/swift-marshal","owner":"ericodx","description":"Ensure consistent member ordering in Swift types to improve readability and maintainability.","archived":false,"fork":false,"pushed_at":"2026-03-30T13:37:56.000Z","size":1041,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T15:25:50.357Z","etag":null,"topics":["cli","swift","swift-package-manager","xcode-plugin"],"latest_commit_sha":null,"homepage":"https://github.com/ericodx/swift-marshal","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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-03-15T15:23:12.000Z","updated_at":"2026-03-30T13:38:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ericodx/swift-marshal","commit_stats":null,"previous_names":["ericodx/swift-marshal"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ericodx/swift-marshal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-marshal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-marshal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-marshal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-marshal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericodx","download_url":"https://codeload.github.com/ericodx/swift-marshal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericodx%2Fswift-marshal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31384845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T01:22:39.193Z","status":"ssl_error","status_checked_at":"2026-04-04T01:22:33.970Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["cli","swift","swift-package-manager","xcode-plugin"],"created_at":"2026-04-04T01:42:25.088Z","updated_at":"2026-04-04T01:42:25.677Z","avatar_url":"https://github.com/ericodx.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Marshal\n\n[![Swift Package Index](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fericodx%2Fswift-marshal%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/ericodx/swift-marshal)\n[![Swift Package Index](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fericodx%2Fswift-marshal%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/ericodx/swift-marshal)\n[![CI](https://img.shields.io/github/actions/workflow/status/ericodx/swift-marshal/main-analysis.yml?branch=main\u0026style=flat-square\u0026logo=github\u0026logoColor=white\u0026label=CI\u0026color=4CAF50)](https://github.com/ericodx/swift-marshal/actions)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=deploy-on-friday-swift-marshal\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=deploy-on-friday-swift-marshal)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=deploy-on-friday-swift-marshal\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=deploy-on-friday-swift-marshal)\n\n**Ensure consistent member ordering in Swift types to improve readability and maintainability.**\n\n`swift-marshal` is an AST-based CLI that ensures consistent member ordering within Swift type declarations. It reports violations with `check` and applies fixes with `fix`, driven by SwiftSyntax and a declarative configuration file.\n\n## Why\n\nInconsistent member ordering increases:\n- cognitive load when navigating code\n- friction during code reviews\n- inconsistency across teams and codebases\n\n`swift-marshal` helps maintain a predictable structure, making code easier to read, review, and maintain.\n\n## Features\n\n- Ensures consistent member ordering using AST-based analysis\n- Preserves original logic and formatting\n- Supports automated fixes via CLI\n- Can be integrated into CI pipelines\n- Configurable through a declarative YAML file\n\n## Install\n\n```bash\nbrew tap ericodx/homebrew-tools\nbrew install swift-marshal\n```\n\nOther installation methods — pre-built binary, build from source, pre-commit hook, Xcode plugin — are covered in the [Installation Guide](Docs/INSTALLATION.md).\n\n## Quick start\n\n```bash\n# Generate a config file (auto-detects your source directories)\nswift-marshal init\n\n# Check for violations\nswift-marshal check\n\n# Apply fixes\nswift-marshal fix\n```\n\nExample output:\n\n```\nSources/App/Models/User.swift:\n  struct User (line 3)\n    [needs reordering]\n    original:\n      - instance_method fullName\n      - instance_property firstName\n      - initializer init\n    reordered:\n      - initializer init\n      - instance_property firstName\n      - instance_method fullName\n\n✗ 1 type in 1 file needs reordering\n  Run 'swift-marshal fix' to apply changes\n```\n\n## Configuration\n\nDrop a `.swift-marshal.yaml` in the project root to control member order, paths, and extension handling:\n\n```yaml\nversion: 1\n\nordering:\n  members:\n    - typealias\n    - associatedtype\n    - initializer\n    - type_property\n    - instance_property\n    - subtype\n    - type_method\n    - instance_method\n    - subscript\n    - deinitializer\n\nextensions:\n  strategy: separate\n  respect_boundaries: true\n\npaths:\n  - Sources/\n```\n\nFull reference in the [Usage \u0026 Configuration Guide](Docs/USAGE.md).\n\n## Documentation\n\n| Document | Description |\n|---|---|\n| [Installation](Docs/INSTALLATION.md) | Homebrew, binary, source, pre-commit hook, Xcode plugin |\n| [Usage \u0026 Configuration](Docs/USAGE.md) | CLI options, YAML config, output formats, CI integration |\n| [Architecture](Docs/Architecture/README.md) | Module map, pipeline design, configuration model, AST rewriting |\n| [Codebase Reference](Docs/CodeBase/README.md) | Every type, protocol, and stage documented |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericodx%2Fswift-marshal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericodx%2Fswift-marshal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericodx%2Fswift-marshal/lists"}