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.

Add rule to exclude a path, like the inverse of `pick`

See original GitHub issue

Feature request: In cases where there are lots of directories and files to include from a dependency module except one, it would be nice to be able to specify explicit paths to omit completely, rather than using pick to verbosely declare everything to include.

I would suggest either:

  1. Add an omit or exclude keyword for use in rule definitions
  2. Support exclusion rules as part of pick statements with bangs, e.g. pick: ! hey/neat/this/could/also/support/globbing/**

I think I prefer 2.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:26 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
olson-sean-kcommented, Apr 27, 2016

drop looks good to me!

A bit unrelated, but before bumping to 1.0, maybe we can review open issues and discuss?

1reaction
oconnor663commented, Apr 26, 2016

Ugh, I hate that PyYAML silently drops duplicated fields. There’s a very hacky warning in place to try to detect cases where that’s happening though. Did it trigger for you when you duplicated the delete field?

As happy as I am to see someone using a multi-rule pipe, you’re right that you don’t need it in this case. What you want here is to give delete a YAML-formatted list of entries. So either this:

rule skip-default-wp-themes:
  delete:
    - wp-content/themes/twenty*
    - wp-content/plugins/hello.php

or this

rule skip-default-wp-themes:
  delete: ["wp-content/themes/twenty*", "wp-content/plugins/hello.php"]

I don’t think the quotes are strictly necessary in that second example, but YAML parsing starts to get really unpredictable as soon as * and other interesting syntax get involved.

I haven’t documented this yet, mostly because I felt like the README was getting too long, and I didn’t want to weigh it down with too many advanced use cases. I think what I should do now is split off an Advanced document, cram all this stuff in there, and just link to it from the main. We could move a ton of stuff under the fold like that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

glob exclude pattern - python - Stack Overflow
I want to exclude all files that start with eph with the glob function. How can I do it? python · glob ·...
Read more >
Exclude all files except for... · Issue #869 · microsoft/vscode
The files exclude allows you to set true/false values, but it doesn't seem to take them completely into account. For example, I would...
Read more >
Adding and removing conditions in a rule - AWS Documentation
Choose the name of the rule in which you want to add or remove conditions. ... If you want AWS WAF Classic to...
Read more >
Exclude a directory or multiple directories while using find ...
We can exclude directories by using the help of “path“, “prune“, “o” and “print” switches with find command. See the example: # find...
Read more >
Creating a scan exclusion - Kaspersky Knowledge Base
In this window, you can create a scan exclusion using one or both of the criteria from the Properties section. To exclude a...
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