question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for exclusion paths

See original GitHub issue

There are cases where we want to match an entire directory but not certain subdirectories.

Instead of having to list each matching subdirectory, it would be nice to be able to exclude some paths from a match.

An example may be:

label1:
- match: "example1/**/*"
  exclude: ["example1/foo/*", "example1/bar/*"]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
damccormcommented, Aug 22, 2019

This seems like a helpful idea! I think we probably should be able to do something like this, I want to be careful here though - I don’t want to break existing configurations, so I don’t want to change the syntax of the yml file.

I think a better approach might be to support ! as a negate pattern. So you’re example would look the following instead:

label1:
- "!example1/foo/*"
- "!example1/bar/*"
- "example1/**/*"

Probably, we’d want to evaluate sequentially until we find a pattern that matches. So that way we could even do something like:

label2:
- "!example2/foo/bar"
- "example2/foo/**/*"
- "!example2/**/*"
- "**/*"

The above example would not match example2/foo/bar/abc.txt, would match example2/foo/baz/abc.txt, would not match example2/notFoo/baz/abc.txt, and would match notExample2/foo/baz/abc.txt since the patterns are evaluated in order - I think this would be about as powerful as we can get.

Thoughts?

0reactions
jalazizcommented, Apr 26, 2020

i’m trying to use this to match only if specific file is changed, but not if that specific file and another one are modified but dosn’t seem possible with this change.

the idea would be to add the label only if all the files match the pattern, is that possible?

@fluzzi discussion is taking place in #22. However, I think I can support your use case if the maintainers are willing to accept my map configuration proposal.

Your use case could be represented as:

label1:
- match: "example1/foo"
  exclude: ["example1/bar"]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for Create Path-based Exclusions - SonicWall
This article provides a detailed overview on exclusion rules within Capture Client. These rules apply to path (file and folder) exclusions for all...
Read more >
Add an exclusion to Windows Security - Microsoft Support
Select Add an exclusion, and then select from files, folders, file types, or process. A folder exclusion will apply to all subfolders within...
Read more >
exclusionPaths | Apple Developer Documentation
exclusionPaths. An array of path objects that represents the regions where text doesn't display in the text container.
Read more >
Excluded Paths | Acunetix
You can exclude specific parts of a web application from the scan by specifying paths to exclude based on regular expressions. For example: ......
Read more >
UNC and system path variables support in the scan exclusion ...
Know if both Universal Naming Convention (UNC) path and system path variables are supported when configuring OfficeScan exclusion list.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found