Skip to content

Commit ca4441c

Browse files
Copilotcamc314
andauthored
feat(website): Add note about .gitignore only being respected in Git repositories (#14443)
- [x] Understand the PR changes that need to be replicated in the oxc repository - [x] Modify the CLI documentation generation code to add the note about .gitignore - [x] Update the test snapshots - [x] Verify the changes work correctly - [x] Explore using Rust doc comments to generate the note (as requested in review) - [x] Confirmed that bpaf doesn't support footer documentation in structs - [x] Kept the string replacement approach as it's the only way to achieve the desired output Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: camc314 <[email protected]>
1 parent 422f54e commit ca4441c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

tasks/website/src/linter/cli.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn generate_cli() -> String {
2929
// Hack usage line
3030
let markdown = markdown.replacen("**Usage**:", "## Usage\n", 1);
3131

32-
markdown
32+
let markdown = markdown
3333
.split('\n')
3434
.flat_map(|line| {
3535
// Hack the bug on the line containing `###`
@@ -50,5 +50,12 @@ fn generate_cli() -> String {
5050
}
5151
})
5252
.collect::<Vec<_>>()
53-
.join("\n")
53+
.join("\n");
54+
55+
// Add note about .gitignore only being respected inside Git repositories
56+
// This note should appear after the ignore options and before "Handle Warnings"
57+
markdown.replace(
58+
"\n\n## Handle Warnings\n",
59+
"\n\n> [!NOTE]\n> `.gitignore` is only respected inside a Git repository.\n\n## Handle Warnings\n"
60+
)
5461
}

tasks/website/src/linter/snapshots/cli.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ Arguments:
101101

102102

103103

104+
> [!NOTE]
105+
> `.gitignore` is only respected inside a Git repository.
106+
104107
## Handle Warnings
105108
- **` --quiet`** &mdash;
106109
Disable reporting on warnings, only errors are reported

0 commit comments

Comments
 (0)