Exclude rules for certain files
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Improvement Request
It would be nice to be able to set exclusions for certain rules. For example - exclude force_cast rule in tests only. When setting a custom rule, you can use the excluded argument to say which files to exclude using your custom rule on. This doesn't seem to work on the rules already defined (such as force_cast).
I don't want to use nested configurations, as there are multiple targets for this project and I rather not have to maintain a separate config per target when all I'm asking for is an exclusion in test files for certain rules. Also, the organization of this project make test files go underneath the target directory, so a regex such as the one used on the README under customer rules ".*Test\\.swift" is a more flexible way to handle this use case.
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 by tracing how the existing excluded argument works for custom rules and comparing it with configuration of built-in rules. Done means a configuration can exclude a built-in rule such as force_cast from matching files, including test-file patterns, without requiring nested configurations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100