Skip to content

Commit 8bb2371

Browse files
committed
docs: Add shebang to comment section
1 parent 5e1d496 commit 8bb2371

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

crates/roughly/src/format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,7 @@ fn parse_directive(text: &str) -> Option<Directive> {
11661166
.and_then(|rhs| match rhs.trim() {
11671167
"skip" => Some(Directive::Skip),
11681168
"skip-file" => Some(Directive::SkipFile),
1169+
"skip file" => Some(Directive::SkipFile),
11691170
"on" => Some(Directive::On),
11701171
"off" => Some(Directive::Off),
11711172
_ => None,

crates/roughly/tests/format/formatter.template.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Comments are reformatted to ensure consistent spacing while preserving their con
9595

9696
```r
9797
# comments : compare
98+
#!/usr/bin/env Rscript
9899
#This is a comment
99100
#'This is roxygen
100101
##This is a header
@@ -104,7 +105,7 @@ Comments are reformatted to ensure consistent spacing while preserving their con
104105

105106
- Roxygen comments (`#'`) maintain their structure
106107
- Header comments (`##`, `###`) keep their formatting
107-
- Shebangs (`#!/usr/bin/env Rscript`) remain unchanged
108+
- Shebangs (`[#!/usr/bin/env Rscript](http://roughly.dev/)`) remain unchanged
108109
- Comments with quotes (`#'quoted'`) are left as-is to avoid conflicts
109110

110111
### Line Spacing

crates/roughly/tests/snapshots/test_format__documentation_examples__comments.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
source: crates/roughly/tests/test_format.rs
33
expression: code
44
---
5+
#!/usr/bin/env Rscript
56
# This is a comment
67
#' This is roxygen
78
##This is a header

docs/content/formatter.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ Comments are reformatted to ensure consistent spacing while preserving their con
119119

120120
```r
121121
# Before formatting
122+
#!/usr/bin/env Rscript
122123
#This is a comment
123124
#'This is roxygen
124125
##This is a header
125126

126127
# After formatting
128+
#!/usr/bin/env Rscript
127129
# This is a comment
128130
#' This is roxygen
129131
##This is a header
@@ -133,7 +135,7 @@ Comments are reformatted to ensure consistent spacing while preserving their con
133135

134136
- Roxygen comments (`#'`) maintain their structure
135137
- Header comments (`##`, `###`) keep their formatting
136-
- Shebangs (`#!/usr/bin/env Rscript`) remain unchanged
138+
- Shebangs (`[#!/usr/bin/env Rscript](http://roughly.dev/)`) remain unchanged
137139
- Comments with quotes (`#'quoted'`) are left as-is to avoid conflicts
138140

139141
### Line Spacing

0 commit comments

Comments
 (0)