Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Src/CSharpier.Cli/FormattingCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static async Task<IFormattingCache> InitializeAsync(
CancellationToken cancellationToken
)
{
if (commandLineOptions.NoCache || commandLineOptions.Check)
if (commandLineOptions.NoCache)
{
return NullCache;
}
Expand Down
8 changes: 7 additions & 1 deletion Src/CSharpier.Cli/FormattingCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public static Command CreateCheckCommand()
);
var directoryOrFileArgument = AddDirectoryOrFileArgument(checkCommand);

var useCacheOption = new Option<bool>(
["--use-cache"],
"Use the cache to determine if a file needs to be formatted."
);
checkCommand.AddOption(useCacheOption);
checkCommand.AddOption(ConfigPathOption);
checkCommand.AddOption(IgnorePathOption);
checkCommand.AddOption(LogFormatOption);
Expand All @@ -102,6 +107,7 @@ public static Command CreateCheckCommand()
checkCommand.SetHandler(async context =>
{
var directoryOrFile = context.ParseResult.GetValueForArgument(directoryOrFileArgument);
var useCache = context.ParseResult.GetValueForOption(useCacheOption);
var noMSBuildCheck = context.ParseResult.GetValueForOption(NoMsBuildCheckOption);
var includeGenerated = context.ParseResult.GetValueForOption(IncludeGeneratedOption);
var compilationErrorsAsWarnings = context.ParseResult.GetValueForOption(
Expand All @@ -122,7 +128,7 @@ public static Command CreateCheckCommand()
skipValidation: false,
skipWrite: false,
writeStdout: false,
noCache: false,
noCache: !useCache,
noMSBuildCheck,
includeGenerated,
compilationErrorsAsWarnings,
Expand Down
Loading