Skip to content

Commit

Permalink
Fix cache-strategy definition
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed May 30, 2022
1 parent 9499918 commit a1a9d47
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/cli/constant.js
Expand Up @@ -88,8 +88,7 @@ const options = {
},
],
default: "metadata",
describe:
"Strategy for the cache to use for detecting changed files. Can be either `metadata` or `content`. ",
description: "Strategy for the cache to use for detecting changed files.",
type: "choice",
},
check: {
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/__tests__/__snapshots__/early-exit.js.snap
Expand Up @@ -141,6 +141,9 @@ Other options:
--cache Only format changed files. Cannot use with --stdin-filepath.
Defaults to false.
--cache-strategy <metadata|content>
Strategy for the cache to use for detecting changed files.
Defaults to metadata.
--no-color Do not colorize error messages.
--no-error-on-unmatched-pattern
Prevent errors when pattern is unmatched.
Expand Down Expand Up @@ -313,6 +316,9 @@ Other options:
--cache Only format changed files. Cannot use with --stdin-filepath.
Defaults to false.
--cache-strategy <metadata|content>
Strategy for the cache to use for detecting changed files.
Defaults to metadata.
--no-color Do not colorize error messages.
--no-error-on-unmatched-pattern
Prevent errors when pattern is unmatched.
Expand Down
18 changes: 18 additions & 0 deletions tests/integration/__tests__/__snapshots__/help-options.js.snap
Expand Up @@ -57,6 +57,24 @@ Default: false

exports[`show detailed usage with --help cache (write) 1`] = `[]`;

exports[`show detailed usage with --help cache-strategy (stderr) 1`] = `""`;

exports[`show detailed usage with --help cache-strategy (stdout) 1`] = `
"--cache-strategy <metadata|content>
Strategy for the cache to use for detecting changed files.
Valid options:
metadata Use the file metadata such as timestamps as cache keys
content Use the file content as cache keys
Default: metadata
"
`;

exports[`show detailed usage with --help cache-strategy (write) 1`] = `[]`;

exports[`show detailed usage with --help check (stderr) 1`] = `""`;

exports[`show detailed usage with --help check (stdout) 1`] = `
Expand Down

0 comments on commit a1a9d47

Please sign in to comment.