realm / realm/SwiftLint

Exclude path with directory name

Open
#3,586 8 comments 10 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
Describe the bug

There is current wildcard functionality for excluded paths (https://github.com/realm/SwiftLint/issues/1220 | https://github.com/realm/SwiftLint/pull/2316/files), but it doesn't seem to work for matching directory name in along any path (or I am using regex exclusions incorrectly).

I'd like be able to exclude any source file along a path with a directory matching a given name. E.g., I want to exclude anything in a "Tests" folder (or sub-folder), something along the lines of

excluded:
    - "**/Tests/**"

Am I using this wrong or is this not supported? I've tried many iterations without success.

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

No source file or test is named in the issue. Start by tracing SwiftLint's excluded-path wildcard matching, using the linked issue and pull request for context, then verify whether a pattern such as /Tests/ excludes files under matching directories along any path.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.