Skip to content

Commit 598e32b

Browse files
hubwriterCopilot
andauthored
Add glob examples for path-specific custom instructions doc (#58509)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6c632ed commit 598e32b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

data/reusables/copilot/custom-instructions-path.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@
2020
---
2121
```
2222

23-
To apply the instructions to all files, use `applyTo: "**"`, `applyTo: "*"`, or `applyTo: "**/*"`.
23+
Glob examples:
24+
25+
* `*` - will all match all files in the current directory.
26+
* `**` or `**/*` - will all match all files in all directories.
27+
* `*.py` - will match all `.py` files in the current directory.
28+
* `**/*.py` - will recursively match all `.py` files in all directories.
29+
* `src/*.py` - will match all `.py` files in the `src` directory. For example, `src/foo.py` and `src/bar.py` but _not_ `src/foo/bar.py`.
30+
* `src/**/*.py` - will recursively match all `.py` files in the `src` directory. For example, `src/foo.py`, `src/foo/bar.py`, and `src/foo/bar/baz.py`.
31+
* `**/subdir/**/*.py` - will recursively match all `.py` files in any `subdir` directory at any depth. For example, `subdir/foo.py`, `subdir/nested/bar.py`, `parent/subdir/baz.py`, and `deep/parent/subdir/nested/qux.py`, but _not_ `foo.py` at a path that does not contain a `subdir` directory.
2432

2533
1. Optionally, to prevent the file from being used by either {% data variables.copilot.copilot_coding_agent %} or {% data variables.copilot.copilot_code-review_short %}, add the `excludeAgent` keyword to the frontmatter block. Use either `"code-review"` or `"coding-agent"`.
2634

2735
For example, the following file will only be read by {% data variables.copilot.copilot_coding_agent %}.
28-
36+
2937
```markdown
3038
---
3139
applyTo: "**"

0 commit comments

Comments
 (0)