File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public static async Task<IFormattingCache> InitializeAsync(
3232 CancellationToken cancellationToken
3333 )
3434 {
35- if ( commandLineOptions . NoCache || commandLineOptions . Check )
35+ if ( commandLineOptions . NoCache )
3636 {
3737 return NullCache ;
3838 }
Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ public static Command CreateCheckCommand()
9090 ) ;
9191 var directoryOrFileArgument = AddDirectoryOrFileArgument ( checkCommand ) ;
9292
93+ var noCacheOption = new Option < bool > (
94+ [ "--no-cache" ] ,
95+ "Bypass the cache to determine if a file needs to be formatted."
96+ ) ;
97+ checkCommand . AddOption ( noCacheOption ) ;
9398 checkCommand . AddOption ( ConfigPathOption ) ;
9499 checkCommand . AddOption ( IgnorePathOption ) ;
95100 checkCommand . AddOption ( LogFormatOption ) ;
@@ -102,6 +107,7 @@ public static Command CreateCheckCommand()
102107 checkCommand . SetHandler ( async context =>
103108 {
104109 var directoryOrFile = context . ParseResult . GetValueForArgument ( directoryOrFileArgument ) ;
110+ var noCache = context . ParseResult . GetValueForOption ( noCacheOption ) ;
105111 var noMSBuildCheck = context . ParseResult . GetValueForOption ( NoMsBuildCheckOption ) ;
106112 var includeGenerated = context . ParseResult . GetValueForOption ( IncludeGeneratedOption ) ;
107113 var compilationErrorsAsWarnings = context . ParseResult . GetValueForOption (
@@ -122,7 +128,7 @@ public static Command CreateCheckCommand()
122128 skipValidation : false ,
123129 skipWrite : false ,
124130 writeStdout : false ,
125- noCache : false ,
131+ noCache ,
126132 noMSBuildCheck ,
127133 includeGenerated ,
128134 compilationErrorsAsWarnings ,
You can’t perform that action at this time.
0 commit comments