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: fix behaviour on Windows. #593
Conversation
value | ||
.replace(new RegExp(escapeStringRegexp(snapshotsDir), "g"), "[SNAPSHOT]") | ||
// normalize path sep for windows, but it should not replace \n etc... | ||
.replace(/\\(?![tn])/g, "/") |
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.
snapshot testing includes file path
packages/secretlint/src/cli.ts
Outdated
@@ -125,7 +125,7 @@ export const run = async ( | |||
}); | |||
if (flags.debug) { | |||
const debug = await import("debug"); | |||
debug.enable("*secretlint*"); | |||
debug.default?.enable("*secretlint*"); |
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.
--debug does not works?
// dynamic import require file url | ||
const fileUrl = url.pathToFileURL(formatterPath).href; | ||
formatter = moduleInterop(await import(fileUrl)).default; |
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.
Previously, windows can not load custom formatter
Fix various bugs on Windows
secretlint --debug
@secretlint/tester
normalize file path by defaultsecretlint [windows path]
supportsrefs #590