feat(doc): Add examples to exclusions section on how to construct patterns for relative paths
@@ -83,6 +83,12 @@ Examples
This property accepts explicit paths relative to the project's root, or you may specify glob-style patterns.
+
+When specifying path patterns:
+
+* Use '*' to match 0 or more directory name characters (will not cross directory boundaries).
+* Use '**' to match 0 or more directory path characters (will cross directory boundaries).
+
Examples
| Value | Excluded | Not Excluded |
@@ -91,12 +97,24 @@ Examples
| `**/foo/bar` | /projectRoot/dir/foo/bar & /projectRoot/directory/foo/bar | |
| `/projectRoot/d*/*` | /projectRoot/dir/foo & /projectRoot/directory/bar | |
-When specifying path patterns:
+${solution_name} uses FileSystem::getPatchMatcher and its glob syntax implementation to exclude path patterns. See [here](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)) for more info.
-* Use '*' to match 0 or more directory name characters (will not cross directory boundaries).
-* Use '**' to match 0 or more directory path characters (will cross directory boundaries).
+#### Wildcards in relative path patterns
-${solution_name} uses FileSystem::getPatchMatcher and its glob syntax implementation to exclude path patterns. See [here](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)) for more info.
+When excluding paths, if you want to use wildcards in an exclusion pattern for a relative path, there are some confusing rules.
+
+Name-wildcards ('*'), unless appearing in a pattern that begins with path-wildcards ('**'), will only work if the pattern refers to one-level below the source path root.
+
+Let's say you want to exclude /project/folder while scanning /project:
+
+| Value | Excluded | Not Excluded |
+| --- | --- | --- |
+| `*older` | /project/folder | |
+| `f*` | /project/folder | |
+| `folder/*` | | /project/folder or /project/folder/dir |
+| `**folder/*` | /project/folder/dir | /project/folder |
+| `*older/*` | | /project/folder or /project/folder/dir |
+| `**/*older/*` | /project/folder/dir | /project/folder |
### Related properties:
