New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
match_files with negated path spec #80
Comments
Some ideas on how it could be achieved:
|
|
The most convenient way to find files under a directory, and exclude some based upon gitignore patterns is to treat the files as sets, and perform operations from there: import pathspec
import pathspec.util
ignore_spec = pathspec.GitIgnoreSpec.from_lines([
"*.txt",
# ...
])
all_files = set(pathspec.util.iter_tree_files("/some/directory"))
ignore_files = set(ignore_spec.match_files(all_files))
keep_files = all_files - ignore_files I think your 3rd suggestion of adding a negate parameter to |
Yes, a The current approach with scanning the directory tree twice does not seem optimal to me :( Meanwhile I also realized that there is a decently convenient way in the current state as well, without pulling too much of internals with it: def match_files_negated(exclude: pathspec.PathSpec, root: str) -> Iterable[str]:
for path in pathspec.util.iter_tree_files(root):
if not exclude.match_file(path):
yield path |
The |
Bumps [pathspec](https://github.com/cpburnz/python-pathspec) from 0.11.1 to 0.11.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/releases">pathspec's releases</a>.</em></p> <blockquote> <h2>v0.11.2</h2> <p>Release v0.11.2. See <a href="https://github.com/cpburnz/python-pathspec/blob/v0.11.2/CHANGES.rst">CHANGES.rst</a>.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/blob/master/CHANGES.rst">pathspec's changelog</a>.</em></p> <blockquote> <h2>0.11.2 (2023-07-28)</h2> <p>New features:</p> <ul> <li><code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>_: match_files with negated path spec. <code>pathspec.PathSpec.match_*()</code> now have a <code>negate</code> parameter to make using <em>.gitignore</em> logic easier and more efficient.</li> </ul> <p>Bug fixes:</p> <ul> <li><code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>_: Add edge case: patterns that end with an escaped space</li> <li><code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code><em>/<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code></em>: Negate with caret symbol as with the exclamation mark.</li> </ul> <p>.. _<code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/76">cpburnz/python-pathspec#76</a> .. _<code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/77">cpburnz/python-pathspec#77</a> .. _<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/78/">cpburnz/python-pathspec#78</a> .. _<code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/80">cpburnz/python-pathspec#80</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cpburnz/python-pathspec/commit/878be226c5324a4c5470c2ff86034d27c0734d70"><code>878be22</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/c0aca9fa0fe4aaa7967beb717f726ed36d9ab2fe"><code>c0aca9f</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/fb2246c0b50b95803b8abee2b2bfbdca39850918"><code>fb2246c</code></a> Implement issue 80</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/933dd7da982551300a584c98570993402a56bc27"><code>933dd7d</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/dfb630b7bd42956bdd6834c651806d010e01e5f6"><code>dfb630b</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/cebf13fe5c986178d277bc7e01baa28fd10742d2"><code>cebf13f</code></a> Merge pull request <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/78">#78</a> from tomruk/caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/518db79aa414816ac41b752e94ddb1b25850304d"><code>518db79</code></a> Merge branch 'master' into caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/57fbd3ed69597d35a50c56446d60e2c17ab04baf"><code>57fbd3e</code></a> Pass caret negation</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/6b58e23b6038051fb2d690691912bca3dffcde97"><code>6b58e23</code></a> Negate with caret symbol as with the exclamation mark</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/b9a014e560af033591d8cfe7734deb929cc52f67"><code>b9a014e</code></a> Update CHANGES</li> <li>Additional commits viewable in <a href="https://github.com/cpburnz/python-pathspec/compare/v0.11.1...v0.11.2">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pathspec&package-manager=pip&previous-version=0.11.1&new-version=0.11.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pathspec](https://github.com/cpburnz/python-pathspec) from 0.11.1 to 0.11.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/releases">pathspec's releases</a>.</em></p> <blockquote> <h2>v0.11.2</h2> <p>Release v0.11.2. See <a href="https://github.com/cpburnz/python-pathspec/blob/v0.11.2/CHANGES.rst">CHANGES.rst</a>.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/blob/master/CHANGES.rst">pathspec's changelog</a>.</em></p> <blockquote> <h2>0.11.2 (2023-07-28)</h2> <p>New features:</p> <ul> <li><code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>_: match_files with negated path spec. <code>pathspec.PathSpec.match_*()</code> now have a <code>negate</code> parameter to make using <em>.gitignore</em> logic easier and more efficient.</li> </ul> <p>Bug fixes:</p> <ul> <li><code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>_: Add edge case: patterns that end with an escaped space</li> <li><code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code><em>/<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code></em>: Negate with caret symbol as with the exclamation mark.</li> </ul> <p>.. _<code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/76">cpburnz/python-pathspec#76</a> .. _<code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/77">cpburnz/python-pathspec#77</a> .. _<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/78/">cpburnz/python-pathspec#78</a> .. _<code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/80">cpburnz/python-pathspec#80</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cpburnz/python-pathspec/commit/878be226c5324a4c5470c2ff86034d27c0734d70"><code>878be22</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/c0aca9fa0fe4aaa7967beb717f726ed36d9ab2fe"><code>c0aca9f</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/fb2246c0b50b95803b8abee2b2bfbdca39850918"><code>fb2246c</code></a> Implement issue 80</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/933dd7da982551300a584c98570993402a56bc27"><code>933dd7d</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/dfb630b7bd42956bdd6834c651806d010e01e5f6"><code>dfb630b</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/cebf13fe5c986178d277bc7e01baa28fd10742d2"><code>cebf13f</code></a> Merge pull request <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/78">#78</a> from tomruk/caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/518db79aa414816ac41b752e94ddb1b25850304d"><code>518db79</code></a> Merge branch 'master' into caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/57fbd3ed69597d35a50c56446d60e2c17ab04baf"><code>57fbd3e</code></a> Pass caret negation</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/6b58e23b6038051fb2d690691912bca3dffcde97"><code>6b58e23</code></a> Negate with caret symbol as with the exclamation mark</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/b9a014e560af033591d8cfe7734deb929cc52f67"><code>b9a014e</code></a> Update CHANGES</li> <li>Additional commits viewable in <a href="https://github.com/cpburnz/python-pathspec/compare/v0.11.1...v0.11.2">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pathspec&package-manager=pip&previous-version=0.11.1&new-version=0.11.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pathspec](https://github.com/cpburnz/python-pathspec) from 0.11.1 to 0.11.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/releases">pathspec's releases</a>.</em></p> <blockquote> <h2>v0.11.2</h2> <p>Release v0.11.2. See <a href="https://github.com/cpburnz/python-pathspec/blob/v0.11.2/CHANGES.rst">CHANGES.rst</a>.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/blob/master/CHANGES.rst">pathspec's changelog</a>.</em></p> <blockquote> <h2>0.11.2 (2023-07-28)</h2> <p>New features:</p> <ul> <li><code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>_: match_files with negated path spec. <code>pathspec.PathSpec.match_*()</code> now have a <code>negate</code> parameter to make using <em>.gitignore</em> logic easier and more efficient.</li> </ul> <p>Bug fixes:</p> <ul> <li><code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>_: Add edge case: patterns that end with an escaped space</li> <li><code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code><em>/<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code></em>: Negate with caret symbol as with the exclamation mark.</li> </ul> <p>.. _<code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/76">cpburnz/python-pathspec#76</a> .. _<code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/77">cpburnz/python-pathspec#77</a> .. _<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/78/">cpburnz/python-pathspec#78</a> .. _<code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/80">cpburnz/python-pathspec#80</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cpburnz/python-pathspec/commit/878be226c5324a4c5470c2ff86034d27c0734d70"><code>878be22</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/c0aca9fa0fe4aaa7967beb717f726ed36d9ab2fe"><code>c0aca9f</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/fb2246c0b50b95803b8abee2b2bfbdca39850918"><code>fb2246c</code></a> Implement issue 80</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/933dd7da982551300a584c98570993402a56bc27"><code>933dd7d</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/dfb630b7bd42956bdd6834c651806d010e01e5f6"><code>dfb630b</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/cebf13fe5c986178d277bc7e01baa28fd10742d2"><code>cebf13f</code></a> Merge pull request <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/78">#78</a> from tomruk/caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/518db79aa414816ac41b752e94ddb1b25850304d"><code>518db79</code></a> Merge branch 'master' into caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/57fbd3ed69597d35a50c56446d60e2c17ab04baf"><code>57fbd3e</code></a> Pass caret negation</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/6b58e23b6038051fb2d690691912bca3dffcde97"><code>6b58e23</code></a> Negate with caret symbol as with the exclamation mark</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/b9a014e560af033591d8cfe7734deb929cc52f67"><code>b9a014e</code></a> Update CHANGES</li> <li>Additional commits viewable in <a href="https://github.com/cpburnz/python-pathspec/compare/v0.11.1...v0.11.2">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pathspec&package-manager=pip&previous-version=0.11.1&new-version=0.11.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pathspec](https://github.com/cpburnz/python-pathspec) from 0.11.1 to 0.11.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/releases">pathspec's releases</a>.</em></p> <blockquote> <h2>v0.11.2</h2> <p>Release v0.11.2. See <a href="https://github.com/cpburnz/python-pathspec/blob/v0.11.2/CHANGES.rst">CHANGES.rst</a>.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/blob/master/CHANGES.rst">pathspec's changelog</a>.</em></p> <blockquote> <h2>0.11.2 (2023-07-28)</h2> <p>New features:</p> <ul> <li><code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>_: match_files with negated path spec. <code>pathspec.PathSpec.match_*()</code> now have a <code>negate</code> parameter to make using <em>.gitignore</em> logic easier and more efficient.</li> </ul> <p>Bug fixes:</p> <ul> <li><code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>_: Add edge case: patterns that end with an escaped space</li> <li><code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code><em>/<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code></em>: Negate with caret symbol as with the exclamation mark.</li> </ul> <p>.. _<code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/76">cpburnz/python-pathspec#76</a> .. _<code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/77">cpburnz/python-pathspec#77</a> .. _<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/78/">cpburnz/python-pathspec#78</a> .. _<code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/80">cpburnz/python-pathspec#80</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cpburnz/python-pathspec/commit/878be226c5324a4c5470c2ff86034d27c0734d70"><code>878be22</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/c0aca9fa0fe4aaa7967beb717f726ed36d9ab2fe"><code>c0aca9f</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/fb2246c0b50b95803b8abee2b2bfbdca39850918"><code>fb2246c</code></a> Implement issue 80</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/933dd7da982551300a584c98570993402a56bc27"><code>933dd7d</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/dfb630b7bd42956bdd6834c651806d010e01e5f6"><code>dfb630b</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/cebf13fe5c986178d277bc7e01baa28fd10742d2"><code>cebf13f</code></a> Merge pull request <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/78">#78</a> from tomruk/caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/518db79aa414816ac41b752e94ddb1b25850304d"><code>518db79</code></a> Merge branch 'master' into caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/57fbd3ed69597d35a50c56446d60e2c17ab04baf"><code>57fbd3e</code></a> Pass caret negation</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/6b58e23b6038051fb2d690691912bca3dffcde97"><code>6b58e23</code></a> Negate with caret symbol as with the exclamation mark</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/b9a014e560af033591d8cfe7734deb929cc52f67"><code>b9a014e</code></a> Update CHANGES</li> <li>Additional commits viewable in <a href="https://github.com/cpburnz/python-pathspec/compare/v0.11.1...v0.11.2">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pathspec&package-manager=pip&previous-version=0.11.1&new-version=0.11.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: stujfiter <korey.earl@gmail.com>
Bumps [pathspec](https://github.com/cpburnz/python-pathspec) from 0.11.1 to 0.11.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/releases">pathspec's releases</a>.</em></p> <blockquote> <h2>v0.11.2</h2> <p>Release v0.11.2. See <a href="https://github.com/cpburnz/python-pathspec/blob/v0.11.2/CHANGES.rst">CHANGES.rst</a>.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/cpburnz/python-pathspec/blob/master/CHANGES.rst">pathspec's changelog</a>.</em></p> <blockquote> <h2>0.11.2 (2023-07-28)</h2> <p>New features:</p> <ul> <li><code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>_: match_files with negated path spec. <code>pathspec.PathSpec.match_*()</code> now have a <code>negate</code> parameter to make using <em>.gitignore</em> logic easier and more efficient.</li> </ul> <p>Bug fixes:</p> <ul> <li><code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>_: Add edge case: patterns that end with an escaped space</li> <li><code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code><em>/<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code></em>: Negate with caret symbol as with the exclamation mark.</li> </ul> <p>.. _<code>Pull [#76](https://github.com/cpburnz/python-pathspec/issues/76)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/76">cpburnz/python-pathspec#76</a> .. _<code>Issue [#77](https://github.com/cpburnz/python-pathspec/issues/77)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/77">cpburnz/python-pathspec#77</a> .. _<code>Pull [#78](https://github.com/cpburnz/python-pathspec/issues/78)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/pull/78/">cpburnz/python-pathspec#78</a> .. _<code>Issue [#80](https://github.com/cpburnz/python-pathspec/issues/80)</code>: <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/80">cpburnz/python-pathspec#80</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cpburnz/python-pathspec/commit/878be226c5324a4c5470c2ff86034d27c0734d70"><code>878be22</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/c0aca9fa0fe4aaa7967beb717f726ed36d9ab2fe"><code>c0aca9f</code></a> Release v0.11.2</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/fb2246c0b50b95803b8abee2b2bfbdca39850918"><code>fb2246c</code></a> Implement issue 80</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/933dd7da982551300a584c98570993402a56bc27"><code>933dd7d</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/dfb630b7bd42956bdd6834c651806d010e01e5f6"><code>dfb630b</code></a> Update CHANGES</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/cebf13fe5c986178d277bc7e01baa28fd10742d2"><code>cebf13f</code></a> Merge pull request <a href="https://redirect.github.com/cpburnz/python-pathspec/issues/78">#78</a> from tomruk/caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/518db79aa414816ac41b752e94ddb1b25850304d"><code>518db79</code></a> Merge branch 'master' into caret-symbol</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/57fbd3ed69597d35a50c56446d60e2c17ab04baf"><code>57fbd3e</code></a> Pass caret negation</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/6b58e23b6038051fb2d690691912bca3dffcde97"><code>6b58e23</code></a> Negate with caret symbol as with the exclamation mark</li> <li><a href="https://github.com/cpburnz/python-pathspec/commit/b9a014e560af033591d8cfe7734deb929cc52f67"><code>b9a014e</code></a> Update CHANGES</li> <li>Additional commits viewable in <a href="https://github.com/cpburnz/python-pathspec/compare/v0.11.1...v0.11.2">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pathspec&package-manager=pip&previous-version=0.11.1&new-version=0.11.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Hi. Thanks for the project.
The path spec concept seems to be inspired by gitignore, but I can't find a convenient way to use it as an actual ignore pattern.
That is, write a spec, and then find all files under a directory that do not match it
The text was updated successfully, but these errors were encountered: