My swift linter guide
Use when installing, configuring, running, fixing, or explaining my-swift-linter, swift-ast-lint rules, .swift-ast-lint.yml, Swift lint diagnostics, or the my-swift-linter CLI.From its SKILL.md
npx -y skills add Ryu0118/my-swift-linter --skill my-swift-linter-guideAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.2 KB, as published. Nobody here has run it
my-swift-linter Guide
my-swift-linter is a SwiftASTLint-based linter that packages opinionated Swift rules for source layout, SwiftUI view declarations, Swift Testing naming, documentation, and modern Swift expression style.
Install
Install the released binary:
curl -fsSL https://raw.githubusercontent.com/Ryu0118/my-swift-linter/main/install.sh | bash
Install with Nest:
nest install Ryu0118/my-swift-linter
Install with mise:
mise use -g ubi:Ryu0118/my-swift-linter
Build from source:
git clone https://github.com/Ryu0118/my-swift-linter.git
cd my-swift-linter
swift build -c release
Run
Run the installed binary:
my-swift-linter <paths> --config .swift-ast-lint.yml
<paths> defaults to .. The default config path is .swift-ast-lint.yml.
Apply available fixes:
my-swift-linter <paths> --fix
Disable cache or select a cache directory:
my-swift-linter <paths> --no-cache
my-swift-linter <paths> --cache-path .build/my-swift-linter-cache
Run from a source checkout:
swift run --package-path /path/to/my-swift-linter my-swift-linter /path/to/Sources
The command exits with code 2 when lint errors remain.
Configure
Create .swift-ast-lint.yml at the target project root:
disabled_rules:
- missing-docs
rules:
deep-nesting:
args:
warning_depth: 3
error_depth: 3
include:
- "Sources/**"
exclude:
- "**/*Generated.swift"
missing-docs:
args:
min_access_level: public
severity: warning
ignore_patterns:
- kinds: [var, let]
modifiers: [static]
names: [liveValue, previewValue, testValue]
Rule configuration uses rules.<rule-id>.args for rule-specific arguments. include and exclude patterns scope a rule to matching paths. Use disabled_rules to turn off rules globally.
Rules
See references/rules.md for the full rule catalog, defaults, fix support, and configuration keys.