Drop confusing second * from glob pattern example#18709
Merged
Conversation
Summary -- As @AlexWaygood noted on the 0.12 release blog post draft, the existing example is a bit confusing. Either `**/*.py` or just `*.py`, as I went with here, makes more sense, although the old version (`scripts/**.py`) also worked when I tested it. However, this probably shouldn't be relied upon since the [globset](https://docs.rs/globset/latest/globset/#syntax) docs say: > Using ** anywhere else is illegal where "anywhere else" comes after the listing of the three valid positions: 1. At the start of a pattern (`**/`) 2. At the end of a pattern (`/**`) 3. Or directly between two slashes (`/**/`) I think the current version is luckily treated the same as a single `*`, and the default globbing settings allow it to match subdirectories such that the new example pattern will apply to the whole `scripts` tree in a project like this: ``` . ├── README.md ├── pyproject.toml ├── scripts │ ├── matching.py │ └── sub │ └── nested.py └── src └── main.py ``` Test Plan -- Local testing of the new pattern, but the specifics of the pattern aren't as important as having a more intuitive-looking/correct example.
Contributor
|
dylwil3
approved these changes
Jun 16, 2025
dcreager
added a commit
that referenced
this pull request
Jun 16, 2025
* main: (38 commits) [`pyupgrade`] Suppress `UP008` diagnostic if `super` symbol is not builtin (#18688) [pylint] Fix `PLW0128` to check assignment targets in square brackets and after asterisks (#18665) [`refurb`] Make the fix for `FURB163` unsafe for `log2`, `log10`, `*args`, and deleted comments (#18645) [ty] allow `T: Never` as subtype of `Never` (#18687) [ty] Use more parallelism when running corpus tests (#18711) [ty] Support `dataclasses.KW_ONLY` (#18677) [`ruff`] Check for non-context-manager use of `pytest.raises`, `pytest.warns`, and `pytest.deprecated_call` (`RUF061`) (#17368) Add syntax error when conversion flag does not immediately follow exclamation mark (#18706) [`flake8-pyi`] Fix `custom-typevar-for-self` with string annotations (`PYI019`) (#18311) Drop confusing second `*` from glob pattern example (#18709) [ty] Stabilize completions (#18650) [ty] Correctly label typeshed-sync PRs (#18702) Update Rust crate memchr to v2.7.5 (#18696) Update dependency react-resizable-panels to v3.0.3 (#18691) Update Rust crate clap to v4.5.40 (#18692) Update Rust crate libcst to v1.8.2 (#18695) Update Rust crate jiff to v0.2.15 (#18693) Update Rust crate libc to v0.2.173 (#18694) Update Rust crate syn to v2.0.103 (#18698) Update Rust crate toml to v0.8.23 (#18699) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
As @AlexWaygood noted on the 0.12 release blog post draft, the existing example is a bit confusing. Either
**/*.pyor just*.py, as I went with here, makes more sense, although the old version (scripts/**.py) also worked when I tested it. However, this probably shouldn't be relied upon since the globset docs say:where "anywhere else" comes after the listing of the three valid positions:
**/)/**)/**/)I think the current version is luckily treated the same as a single
*, and the default globbing settings allow it to match subdirectories such that the new example pattern will apply to the wholescriptstree in a project like this:Test Plan
Local testing of the new pattern, but the specifics of the pattern aren't as important as having a more intuitive-looking/correct example.