Lint with only non-correctable rules
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- I've Updated SwiftLint to the latest version.
- I've searched for existing GitHub issues.
Feature or Enhancement Proposal
Our team had an idea. We like the idea of having build warnings and errors in Xcode while writing code. However, for auto-formatting/correcting, we'd rather that happen at the pre-commit stage rather than while in the middle of working on a file. But, if we do that, then running SwiftLint during the build phase without --fix will cause the auto-correctable rules to be flagged as well.
What I'm looking for is a way to lint with only rules that are not correctable. I could modify the rules file and manually disable all the correctable rules, but when new rules get added later, we'll have to stay on top of this and it's a lot to manage. It seems like SwiftLint could make this an option fairly easily?
A general use case would be for any team that wants to use a separate formatter and only use SwiftLint for linting.
AFAICT I don't see an existing way to do this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SwiftLint's --fix handling and the rules-file configuration path to see how correctable rules are identified. The change is done when a build-phase lint invocation can select only non-correctable rules without manually tracking them, while pre-commit --fix remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100