Fix printing ignored files with --debug-check (#4066)
parent
2b283908cf
commit
240f09794b
|
@ -339,7 +339,9 @@ function formatFiles(context) {
|
||||||
const fileIgnored = ignorer.filter([filename]).length === 0;
|
const fileIgnored = ignorer.filter([filename]).length === 0;
|
||||||
if (
|
if (
|
||||||
fileIgnored &&
|
fileIgnored &&
|
||||||
(context.argv["write"] || context.argv["list-different"])
|
(context.argv["debug-check"] ||
|
||||||
|
context.argv["write"] ||
|
||||||
|
context.argv["list-different"])
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`ignore file when using --debug-check (stderr) 1`] = `""`;
|
||||||
|
|
||||||
|
exports[`ignore file when using --debug-check (stdout) 1`] = `
|
||||||
|
"other-regular-modules.js
|
||||||
|
"
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`ignore file when using --debug-check (write) 1`] = `Array []`;
|
||||||
|
|
||||||
exports[`ignore path (stderr) 1`] = `""`;
|
exports[`ignore path (stderr) 1`] = `""`;
|
||||||
|
|
||||||
exports[`ignore path (stdout) 1`] = `
|
exports[`ignore path (stdout) 1`] = `
|
||||||
|
|
|
@ -19,6 +19,12 @@ describe("support .prettierignore", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("ignore file when using --debug-check", () => {
|
||||||
|
runPrettier("cli/ignore-path", ["**/*.js", "--debug-check"]).test({
|
||||||
|
status: 0
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("outputs files as-is if no --write", () => {
|
describe("outputs files as-is if no --write", () => {
|
||||||
runPrettier("cli/ignore-path", ["regular-module.js"]).test({
|
runPrettier("cli/ignore-path", ["regular-module.js"]).test({
|
||||||
status: 0
|
status: 0
|
||||||
|
|
Loading…
Reference in New Issue