Skip to content

Commit 08c9f37

Browse files
authored
Apply suggestions from code review
1 parent 0ec9522 commit 08c9f37

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

internal/exec/go_getter_utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (d *CustomGitDetector) Detect(src, _ string) (string, bool, error) {
116116
if err != nil {
117117
log.Debug("Masking failed", "error", err)
118118
} else {
119-
log.Debug("Final URL", "final_url", "git::"+maskedFinal)
119+
log.Debug("Final URL (masked)", "url", "git::"+maskedFinal)
120120
}
121121

122122
return finalURL, true, nil

website/docs/core-concepts/vendor/vendor-manifest.mdx

+33-10
Original file line numberDiff line numberDiff line change
@@ -500,14 +500,37 @@ atmos vendor pull -c vpc
500500

501501
## Vendoring with Globs
502502

503-
When defining vendoring rules in Atmos, **glob patterns** determine which files and directories are included or excluded. Understanding how globs behave—especially when using greedy (`**`) versus non-greedy (`*`) patterns—is crucial for precise vendoring.
503+
In Atmos, **glob patterns** define which files and directories are included or excluded during vendoring. These patterns go beyond simple wildcard characters like `*`—they follow specific rules that dictate how paths are matched. Understanding the difference between **greedy** (`**`) and **non-greedy** (`*`) patterns, along with other advanced glob syntax, ensures precise control over vendoring behavior.
504504

505-
### Understanding Greedy and Non-Greedy Globs
505+
### Understanding Wildcards, Ranges, and Recursion
506506

507-
Globs use special wildcard characters:
507+
Glob patterns in Atmos provide flexible and powerful matching, that's simpler to understand than regular expressions:
508508

509-
- `*` (single asterisk) matches any sequence of characters **within a single path segment**.
510-
- `**` (double asterisk) matches across multiple path segments **recursively**.
509+
<dl>
510+
<dt>`*` (single asterisk)</dt>
511+
<dd>Matches any sequence of characters <strong>within a single path segment</strong>.</dd>
512+
<dd>Example: `vendor/*.yaml` matches `vendor/config.yaml` but <strong>not</strong> `vendor/subdir/config.yaml`.</dd>
513+
514+
<dt>`**` (double asterisk, also known as a "greedy glob")</dt>
515+
<dd>Matches across <strong>multiple path segments recursively</strong>.</dd>
516+
<dd>Example: `vendor/**/*.yaml` matches `vendor/config.yaml`, `vendor/subdir/config.yaml`, and `vendor/deep/nested/config.yaml`.</dd>
517+
518+
<dt>`?` (question mark)</dt>
519+
<dd>Matches <strong>exactly one character</strong> in a path segment.</dd>
520+
<dd>Example: `file?.txt` matches `file1.txt` and `fileA.txt` but <strong>not</strong> `file10.txt`.</dd>
521+
522+
<dt>`[abc]` (character class)</dt>
523+
<dd>Matches <strong>any single character</strong> inside the brackets.</dd>
524+
<dd>Example: `file[123].txt` matches `file1.txt`, `file2.txt`, and `file3.txt`, but <strong>not</strong> `file4.txt` or `file12.txt`.</dd>
525+
526+
<dt>`[a-z]` (character range)</dt>
527+
<dd>Matches <strong>any single character</strong> within the specified range.</dd>
528+
<dd>Example: `file[a-c].txt` matches `filea.txt`, `fileb.txt`, and `filec.txt`.</dd>
529+
530+
<dt>`{a,b,c}` (brace expansion)</dt>
531+
<dd>Matches <strong>any of the comma-separated patterns</strong>.</dd>
532+
<dd>Example: `*.{jpg,png,gif}` matches `image.jpg`, `image.png`, and `image.gif`.</dd>
533+
</dl>
511534

512535
This distinction is important when excluding specific directories or files while vendoring.
513536

@@ -522,12 +545,12 @@ excluded_paths:
522545
- "**/demo-library/**/stargazers/**"
523546
```
524547
525-
How It Works:
526-
- The included_paths rule `**/demo-library/**` ensures all files inside `demo-library` (at any depth) are vendored.
527-
- The excluded_paths rule `**/demo-library/**/stargazers/**` prevents any files inside `stargazers` subdirectories from being vendored.
548+
How it works:
549+
- The `included_paths` rule `**/demo-library/**` ensures all files inside `demo-library` (at any depth) are vendored.
550+
- The `excluded_paths` rule `**/demo-library/**/stargazers/**` prevents any files inside `stargazers` subdirectories from being vendored.
528551

529552
This means:
530-
- All files within demo-library except those inside any `stargazers` subdirectory are vendored.
553+
- All files within `demo-library` except those inside any `stargazers` subdirectory are vendored.
531554
- Any other files outside `stargazers` are unaffected by this exclusion.
532555

533556
#### Example: A Non-Recursive Pattern That Doesn't Work
@@ -540,7 +563,7 @@ excluded_paths:
540563
```
541564

542565
In this case:
543-
- `**/demo-library/*` only matches immediate children of demo-library, not nested files or subdirectories.
566+
- `**/demo-library/*` only matches immediate children of `demo-library`, not nested files or subdirectories.
544567
- This means `stargazers/` itself could be matched, but its contents might not be explicitly excluded.
545568
- To correctly capture all subdirectories and files while still excluding stargazers, use `**/demo-library/**/*`.
546569

0 commit comments

Comments
 (0)