-
Notifications
You must be signed in to change notification settings - Fork 5.7k
fix: resolve shebang parse error in deno doc --test #26079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: resolve shebang parse error in deno doc --test #26079
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
One request though: could you add a test case for a doc test written in markdown? Something like:
# my-awesome-readme
This is a markdown file.
```ts
#!/usr/bin/env -S deno run --allow-read
import { assertEquals } from "@std/assert/equals";
assertEquals(1 + 2, 3);
```
@MujahedSafaa could you please add a test as pointed above so we can land this PR? |
@magurotuna I updated this pr with a test and fix. PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
The bug has been fixed by updating the regex to ensure that the shebang characters (#!) are no longer excluded. This allows the shebang to be retained and parsed correctly. --------- Co-authored-by: David Sherret <[email protected]>
This PR addresses the issue reported in #26018.
Issue:
Running deno doc --test on a file that contains a shebang results in a parse error.
Solution:
The bug has been fixed by updating the regex to ensure that the shebang characters (#!) are no longer excluded. This allows the shebang to be retained and parsed correctly.
@bartlomieju
@dsherret