realm / realm/SwiftLint

Exclude rules for certain files

Open
#2,355 5 comments 8 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

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.