realm / realm/SwiftLint

Lint with only non-correctable rules

Open
#6,209 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.