A Swift tool for automated code modification, generating boilerplate like access control and initializers based on AST analysis.
swift-mod is a command-line tool for Swift that automates code modifications like adding access control and generating initializers. It analyzes the Abstract Syntax Tree (AST) to intelligently insert or adjust boilerplate code, bridging the gap between raw code generation and formatting.
Swift developers working on modularized codebases who need to maintain consistent access levels and reduce repetitive boilerplate code, such as in libraries or frameworks.
Developers choose swift-mod for its AST-aware approach, which ensures modifications are semantically correct, and for its configurability, allowing tailored automation without disrupting existing code structure.
A tool for Swift code modification intermediating between code generation and formatting.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses SwiftSyntax to ensure modifications are syntactically correct and preserve code intent, avoiding mere formatting changes as highlighted in the philosophy.
Offers YAML-based customization for rules like default access levels and memberwise initializers, with options for indentation and line breaks per the configuration section.
Supports inline comments (e.g., // swift-mod-ignore) to suppress modifications for specific code sections or rules, providing fine-grained control as documented.
Automates repetitive tasks like adding access modifiers and generating initializers, reducing manual coding effort as demonstrated in the example diff.
Only supports a few modification types (e.g., access levels and initializers), lacking common Swift boilerplate generation like Equatable or Codable conformance.
Tightly coupled with SwiftSyntax versions, requiring specific swift-mod releases for different Swift toolchains, as shown in the compatibility table, adding maintenance overhead.
Requires manual setup via YAML files and understanding of rule parameters, which can be time-consuming for quick adoption or small projects.