Skip to content

Commit 0ca78cd

Browse files
committed
Started some work on the JSON schema for the update options
1 parent 1b883e3 commit 0ca78cd

File tree

1 file changed

+159
-0
lines changed

1 file changed

+159
-0
lines changed
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://programmerAL.com/code-updater.schema.json",
4+
"title": "Update Options",
5+
"description": "Settings to use when updating code",
6+
"type": "object",
7+
"properties": {
8+
"updatePathOptions": {
9+
"type": "object",
10+
"properties": {
11+
"rootDirectory": {
12+
"description": "Root directory to run from. Code Updater will search all child directories within this for projects to update.",
13+
"type": "string"
14+
},
15+
"ignorePatterns": {
16+
"description": "String to ignore within file paths when looking for projects to update. This is OS sensitive, so use \\ as the path separator for Windows, and / as the path separator everywhere else. Eg: `\\my-skip-path\\` will ignore all projects that have the text `\\my-skip-path\\` within the full path. Which will only happen on Windows because that uses backslashes for path separators.",
17+
"type": "array",
18+
"items": {
19+
"type": "string"
20+
}
21+
}
22+
},
23+
"required": [ "rootDirectory", "ignorePatterns" ]
24+
},
25+
"cSharpOptions": {
26+
"type": "object",
27+
"properties": {
28+
"csProjVersioningOptions": {
29+
"type": "object",
30+
"properties": {
31+
"targetFramework": {
32+
"description": "Target framework for the project",
33+
"type": "string"
34+
},
35+
"langVersion": {
36+
"description": "Language version for the project",
37+
"type": "string"
38+
},
39+
"treatWarningsAsErrors": {
40+
"description": "Treat warnings as errors",
41+
"type": "boolean"
42+
}
43+
},
44+
"required": [ "targetFramework", "langVersion", "treatWarningsAsErrors" ]
45+
},
46+
"csProjDotNetAnalyzerOptions": {
47+
"type": "object",
48+
"properties": {
49+
"enableNetAnalyzers": {
50+
"description": "True to set the `EnableNetAnalyzers` csproj value to true, false to set it to false",
51+
"type": "boolean"
52+
},
53+
"enforceCodeStyleInBuild": {
54+
"description": "True to set the `EnforceCodeStyleInBuild` csproj value to true, false to set it to false",
55+
"type": "boolean"
56+
}
57+
},
58+
"required": [ "enableNetAnalyzers", "enforceCodeStyleInBuild" ]
59+
},
60+
"cSharpStyleOptions": {
61+
"type": "object",
62+
"properties": {
63+
"runDotnetFormat": {
64+
"description": "True to run the `dotnet format` command",
65+
"type": "boolean"
66+
}
67+
},
68+
"required": [ "runDotnetFormat" ]
69+
},
70+
"nugetAuditOptions": {
71+
"type": "object",
72+
"properties": {
73+
"nuGetAudit": {
74+
"description": "What value to set for the `NuGetAudit` property in the csproj file.",
75+
"type": "boolean"
76+
},
77+
"auditMode": {
78+
"description": "What value to set for the `NuGetAuditMode` property in the csproj file. Valid values are `direct` and `all`.",
79+
"type": "string"
80+
},
81+
"auditLevel": {
82+
"description": "What value to set for the `NuGetAuditLevel` property in the csproj file. Valid values are: `low`, `moderate`, `high`, and `critical`",
83+
"type": "string"
84+
}
85+
},
86+
"required": [ "nuGetAudit", "auditMode", "auditLevel" ]
87+
},
88+
"nuGetUpdateOptions": {
89+
"type": "object",
90+
"properties": {
91+
"updateTopLevelNugetsInCsProj": {
92+
"description": "True to updates all referenced nugets to the latest version. These are the references in the csproj files.",
93+
"type": "boolean"
94+
},
95+
"updateTopLevelNugetsNotInCsProj": {
96+
"description": "True to updates all indirect nugets to the latest version. These are the nugets that are referenced automatically based on SDK chosen or something like that.",
97+
"type": "boolean"
98+
}
99+
}
100+
}
101+
}
102+
},
103+
"npmOptions": {
104+
"type": "object",
105+
"description": "Options for compiling Npm packages after updates. Note if this is not set, but the parent NpmOptions is set, NPM Packages will be updated but not tested with a compile.",
106+
"properties": {
107+
"npmCompileOptions": {
108+
"type": "object",
109+
"properties": {
110+
"npmBuildCommand": {
111+
"description": "Npm command to \"compile\" the npm directory. The CLI command that will be run is: npm run {{NpmBuildCommand}}",
112+
"type": "string"
113+
},
114+
"required": [ "npmBuildCommand" ]
115+
}
116+
}
117+
}
118+
},
119+
"regexSearchOptions": {
120+
"type": "object",
121+
"description": "Regex to search for specific string. Handy for finding things you need to manually update, that this tool can't easily do. For example, setting the correct version of .NET in a YAML file for a CI/CD Pipeline",
122+
"properties": {
123+
"searches": {
124+
"type": "array",
125+
"description": "Collection of searches to make in all files that are not ignored",
126+
"items": {
127+
"type": "object",
128+
"properties": {
129+
"searchRegex": {
130+
"description": "Regex to search for in all files that are not ignored",
131+
"type": "string"
132+
},
133+
"description": {
134+
"description": "Description to show in the output",
135+
"type": "string"
136+
}
137+
},
138+
"required": [ "searchRegex", "description" ]
139+
}
140+
}
141+
}
142+
},
143+
"loggingOptions": {
144+
"type": "object",
145+
"description": "Options for output logging of the operation",
146+
"properties": {
147+
"outputFile": {
148+
"description": "If this is set, it will be the file to write logs to, in addition to the console",
149+
"type": "string"
150+
},
151+
"logLevel": {
152+
"description": "Verbosity level to log. Valid values are: Verbose, Info, Warn, Error. Default value: verbose.",
153+
"type": "string"
154+
}
155+
}
156+
}
157+
},
158+
"required": [ "updatePathOptions" ]
159+
}

0 commit comments

Comments
 (0)