Skip to content

Commit ffd74bc

Browse files
committed
chore: add additional properties to settings.json
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
1 parent 3b9449d commit ffd74bc

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

Code/Light.GuardClauses.SourceCodeTransformation/Program.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

Code/Light.GuardClauses.SourceCodeTransformation/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
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 },

0 commit comments

Comments
 (0)