File tree Expand file tree Collapse file tree
Code/Light.GuardClauses.SourceCodeTransformation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public static int Main(string[] args)
1515
1616 var options = new SourceFileMergeOptions ( ) ;
1717 configuration . Bind ( options ) ;
18+ options = ApplyDefaultPaths ( options ) ;
1819 try
1920 {
2021 Console . WriteLine ( "Merging source files..." ) ;
@@ -35,4 +36,20 @@ public static int Main(string[] args)
3536 return - 1 ;
3637 }
3738 }
39+
40+ private static SourceFileMergeOptions ApplyDefaultPaths ( SourceFileMergeOptions options )
41+ {
42+ if ( ! string . IsNullOrWhiteSpace ( options . SourceFolder ) &&
43+ ! string . IsNullOrWhiteSpace ( options . TargetFile ) )
44+ {
45+ return options ;
46+ }
47+
48+ var defaultOptions = new SourceFileMergeOptions ( ) ;
49+ return options with
50+ {
51+ SourceFolder = string . IsNullOrWhiteSpace ( options . SourceFolder ) ? defaultOptions . SourceFolder : options . SourceFolder ,
52+ TargetFile = string . IsNullOrWhiteSpace ( options . TargetFile ) ? defaultOptions . TargetFile : options . TargetFile
53+ } ;
54+ }
3855}
Original file line number Diff line number Diff line change 11{
2+ "SourceFolder" : " " ,
3+ "TargetFile" : " " ,
4+ "ChangePublicTypesToInternalTypes" : true ,
5+ "BaseNamespace" : " Light.GuardClauses" ,
6+ "RemoveContractAnnotations" : false ,
7+ "IncludeJetBrainsAnnotations" : true ,
8+ "IncludeJetBrainsAnnotationsUsing" : true ,
9+ "IncludeVersionComment" : true ,
10+ "RemoveOverloadsWithExceptionFactory" : false ,
11+ "IncludeCodeAnalysisNullableAttributes" : true ,
12+ "IncludeValidatedNotNullAttribute" : true ,
13+ "RemoveValidatedNotNull" : false ,
14+ "RemoveDoesNotReturn" : false ,
15+ "RemoveNotNullWhen" : false ,
16+ "IncludeCallerArgumentExpressionAttribute" : true ,
17+ "RemoveCallerArgumentExpressions" : false ,
218 "AssertionWhitelist" : {
319 "IsEnabled" : true ,
420 "DerivesFrom" : { "Include" : true , "IncludeExceptionFactoryOverload" : true },
You can’t perform that action at this time.
0 commit comments