Skip to content

Commit 6b52135

Browse files
committed
wip
1 parent dee012b commit 6b52135

35 files changed

+122
-119
lines changed

.editorconfig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
154154
csharp_space_between_method_declaration_parameter_list_parentheses = false
155155
csharp_space_between_square_brackets = false
156156

157-
csharp_use_roslyn_logic_for_evident_types = true
157+
resharper_csharp_use_roslyn_logic_for_evident_types = true
158158

159159
# Alignment
160-
align_multiline_parameter = true
160+
resharper_csharp_align_multiline_parameter = true
161161

162162
# Qualify fields with "this."
163-
csharp_instance_members_qualify_members = field
163+
resharper_csharp_instance_members_qualify_members = field
164164

165165
# IDE0011: Add braces
166166
dotnet_diagnostic.IDE0011.severity = none
@@ -197,4 +197,8 @@ dotnet_diagnostic.RCS1036.severity = error
197197

198198
xml_space_before_self_closing = true
199199

200-
resharper_arrange_object_creation_when_type_not_evident_highlighting = none
200+
resharper_arrange_object_creation_when_type_not_evident_highlighting = none
201+
202+
resharper_unused_auto_property_accessor_global_highlighting = none
203+
204+
resharper_unused_method_return_value_global_highlighting = none

src/GitVersion.App.Tests/HelpWriterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void AllArgsAreInHelp()
5151
.ShouldBeEmpty();
5252
}
5353

54-
private static bool IsNotInHelp(IReadOnlyDictionary<string, string> lookup, string propertyName, string helpText)
54+
private static bool IsNotInHelp(Dictionary<string, string> lookup, string propertyName, string helpText)
5555
{
5656
if (lookup.TryGetValue(propertyName, out var value))
5757
return !helpText.Contains(value);

src/GitVersion.App.Tests/Helpers/ProgramFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void WithEnv(params KeyValuePair<string, string>[] envs)
4949

5050
public Task<ExecutionResults> Run(string arg)
5151
{
52-
var args = arg.Split([' '], StringSplitOptions.RemoveEmptyEntries).ToArray();
52+
var args = arg.Split([' '], StringSplitOptions.RemoveEmptyEntries);
5353
return Run(args);
5454
}
5555

src/GitVersion.App/ArgumentParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,14 +562,14 @@ private static void EnsureArgumentValueCount(IReadOnlyList<string>? values)
562562
}
563563
}
564564

565-
private static NameValueCollection CollectSwitchesAndValuesFromArguments(IList<string> namedArguments, out bool firstArgumentIsSwitch)
565+
private static NameValueCollection CollectSwitchesAndValuesFromArguments(string[] namedArguments, out bool firstArgumentIsSwitch)
566566
{
567567
firstArgumentIsSwitch = true;
568568
var switchesAndValues = new NameValueCollection();
569569
string? currentKey = null;
570570
var argumentRequiresValue = false;
571571

572-
for (var i = 0; i < namedArguments.Count; ++i)
572+
for (var i = 0; i < namedArguments.Length; ++i)
573573
{
574574
var arg = namedArguments[i];
575575

src/GitVersion.App/QuotedStringHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static string[] SplitUnquoted(string? input, char splitChar)
5252

5353
split.Add(input[startIndex..]);
5454

55-
return split.Where(argument => !argument.IsNullOrEmpty()).ToArray();
55+
return [.. split.Where(argument => !argument.IsNullOrEmpty())];
5656
}
5757

5858
/// <summary>

src/GitVersion.BuildAgents/Agents/MyGet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public override string[] SetOutputVariables(string name, string? value)
2828
return [.. messages];
2929
}
3030

31-
public override string? SetBuildNumber(GitVersionVariables variables) =>
31+
public override string SetBuildNumber(GitVersionVariables variables) =>
3232
$"##myget[buildNumber '{ServiceMessageEscapeHelper.EscapeValue(variables.FullSemVer)}']";
3333

3434
public override bool PreventFetch() => false;

src/GitVersion.Configuration/Builders/BranchConfigurationBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public virtual BranchConfigurationBuilder WithRegularExpression(string? value)
8989

9090
public virtual BranchConfigurationBuilder WithSourceBranches(IEnumerable<string> values)
9191
{
92-
WithSourceBranches(values.ToArray());
92+
WithSourceBranches([.. values]);
9393
return this;
9494
}
9595

@@ -101,7 +101,7 @@ public virtual BranchConfigurationBuilder WithSourceBranches(params string[] val
101101

102102
public virtual BranchConfigurationBuilder WithIsSourceBranchFor(IEnumerable<string> values)
103103
{
104-
WithIsSourceBranchFor(values.ToArray());
104+
WithIsSourceBranchFor([.. values]);
105105
return this;
106106
}
107107

src/GitVersion.Configuration/Builders/ConfigurationBuilderBase.cs

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -100,232 +100,230 @@ protected ConfigurationBuilderBase()
100100
}
101101
}
102102

103-
public virtual TConfigurationBuilder WithAssemblyVersioningScheme(AssemblyVersioningScheme? value)
103+
public TConfigurationBuilder WithAssemblyVersioningScheme(AssemblyVersioningScheme? value)
104104
{
105105
this.assemblyVersioningScheme = value;
106106
return (TConfigurationBuilder)this;
107107
}
108108

109-
public virtual TConfigurationBuilder WithAssemblyFileVersioningScheme(AssemblyFileVersioningScheme? value)
109+
public TConfigurationBuilder WithAssemblyFileVersioningScheme(AssemblyFileVersioningScheme? value)
110110
{
111111
this.assemblyFileVersioningScheme = value;
112112
return (TConfigurationBuilder)this;
113113
}
114114

115-
public virtual TConfigurationBuilder WithAssemblyInformationalFormat(string? value)
115+
public TConfigurationBuilder WithAssemblyInformationalFormat(string? value)
116116
{
117117
this.assemblyInformationalFormat = value;
118118
return (TConfigurationBuilder)this;
119119
}
120120

121-
public virtual TConfigurationBuilder WithAssemblyVersioningFormat(string? value)
121+
public TConfigurationBuilder WithAssemblyVersioningFormat(string? value)
122122
{
123123
this.assemblyVersioningFormat = value;
124124
return (TConfigurationBuilder)this;
125125
}
126126

127-
public virtual TConfigurationBuilder WithAssemblyFileVersioningFormat(string? value)
127+
public TConfigurationBuilder WithAssemblyFileVersioningFormat(string? value)
128128
{
129129
this.assemblyFileVersioningFormat = value;
130130
return (TConfigurationBuilder)this;
131131
}
132132

133-
public virtual TConfigurationBuilder WithTagPrefixPattern(string? value)
133+
public TConfigurationBuilder WithTagPrefixPattern(string? value)
134134
{
135135
this.tagPrefix = value;
136136
return (TConfigurationBuilder)this;
137137
}
138138

139-
public virtual TConfigurationBuilder WithVersionInBranchPattern(string? value)
139+
public TConfigurationBuilder WithVersionInBranchPattern(string? value)
140140
{
141141
this.versionInBranchPattern = value;
142142
return (TConfigurationBuilder)this;
143143
}
144144

145-
public virtual TConfigurationBuilder WithNextVersion(string? value)
145+
public TConfigurationBuilder WithNextVersion(string? value)
146146
{
147147
this.nextVersion = value;
148148
return (TConfigurationBuilder)this;
149149
}
150150

151-
public virtual TConfigurationBuilder WithMajorVersionBumpMessage(string? value)
151+
public TConfigurationBuilder WithMajorVersionBumpMessage(string? value)
152152
{
153153
this.majorVersionBumpMessage = value;
154154
return (TConfigurationBuilder)this;
155155
}
156156

157-
public virtual TConfigurationBuilder WithMinorVersionBumpMessage(string? value)
157+
public TConfigurationBuilder WithMinorVersionBumpMessage(string? value)
158158
{
159159
this.minorVersionBumpMessage = value;
160160
return (TConfigurationBuilder)this;
161161
}
162162

163-
public virtual TConfigurationBuilder WithPatchVersionBumpMessage(string? value)
163+
public TConfigurationBuilder WithPatchVersionBumpMessage(string? value)
164164
{
165165
this.patchVersionBumpMessage = value;
166166
return (TConfigurationBuilder)this;
167167
}
168168

169-
public virtual TConfigurationBuilder WithNoBumpMessage(string? value)
169+
public TConfigurationBuilder WithNoBumpMessage(string? value)
170170
{
171171
this.noBumpMessage = value;
172172
return (TConfigurationBuilder)this;
173173
}
174174

175-
public virtual TConfigurationBuilder WithTagPreReleaseWeight(int? value)
175+
public TConfigurationBuilder WithTagPreReleaseWeight(int? value)
176176
{
177177
this.tagPreReleaseWeight = value;
178178
return (TConfigurationBuilder)this;
179179
}
180180

181-
public virtual TConfigurationBuilder WithIgnoreConfiguration(IIgnoreConfiguration value)
181+
public TConfigurationBuilder WithIgnoreConfiguration(IIgnoreConfiguration value)
182182
{
183183
this.ignore = (IgnoreConfiguration)value;
184184
return (TConfigurationBuilder)this;
185185
}
186186

187-
public virtual TConfigurationBuilder WithCommitDateFormat(string? value)
187+
public TConfigurationBuilder WithCommitDateFormat(string? value)
188188
{
189189
this.commitDateFormat = value;
190190
return (TConfigurationBuilder)this;
191191
}
192192

193-
public virtual TConfigurationBuilder WithUpdateBuildNumber(bool value)
193+
public TConfigurationBuilder WithUpdateBuildNumber(bool value)
194194
{
195195
this.updateBuildNumber = value;
196196
return (TConfigurationBuilder)this;
197197
}
198198

199-
public virtual TConfigurationBuilder WithSemanticVersionFormat(SemanticVersionFormat value)
199+
public TConfigurationBuilder WithSemanticVersionFormat(SemanticVersionFormat value)
200200
{
201201
this.semanticVersionFormat = value;
202202
return (TConfigurationBuilder)this;
203203
}
204204

205-
public virtual TConfigurationBuilder WithVersionStrategy(VersionStrategies value)
205+
public TConfigurationBuilder WithVersionStrategy(VersionStrategies value)
206206
{
207-
this.versionStrategies = Enum.GetValues<VersionStrategies>()
208-
.Where(element => element != VersionStrategies.None && value.HasFlag(element))
209-
.ToArray();
207+
this.versionStrategies = [.. Enum.GetValues<VersionStrategies>().Where(element => element != VersionStrategies.None && value.HasFlag(element))];
210208
return (TConfigurationBuilder)this;
211209
}
212210

213-
public virtual TConfigurationBuilder WithVersionStrategies(params VersionStrategies[] values)
211+
public TConfigurationBuilder WithVersionStrategies(params VersionStrategies[] values)
214212
{
215213
this.versionStrategies = values;
216214
return (TConfigurationBuilder)this;
217215
}
218216

219-
public virtual TConfigurationBuilder WithMergeMessageFormats(IReadOnlyDictionary<string, string> value)
217+
public TConfigurationBuilder WithMergeMessageFormats(IReadOnlyDictionary<string, string> value)
220218
{
221219
this.mergeMessageFormats = new(value);
222220
return (TConfigurationBuilder)this;
223221
}
224222

225-
public virtual TConfigurationBuilder WithoutBranches()
223+
public TConfigurationBuilder WithoutBranches()
226224
{
227225
this.branchConfigurationBuilders.Clear();
228226
return (TConfigurationBuilder)this;
229227
}
230228

231-
public virtual BranchConfigurationBuilder WithBranch(string value)
229+
public BranchConfigurationBuilder WithBranch(string value)
232230
=> this.branchConfigurationBuilders.GetOrAdd(value, () => BranchConfigurationBuilder.New);
233231

234-
public virtual BranchConfigurationBuilder WithBranch(string value, BranchConfigurationBuilder builder)
232+
public BranchConfigurationBuilder WithBranch(string value, BranchConfigurationBuilder builder)
235233
=> this.branchConfigurationBuilders.GetOrAdd(value, () => builder);
236234

237-
public virtual TConfigurationBuilder WithBranch(string value, Action<BranchConfigurationBuilder> action)
235+
public TConfigurationBuilder WithBranch(string value, Action<BranchConfigurationBuilder> action)
238236
{
239237
var result = this.branchConfigurationBuilders.GetOrAdd(value, () => BranchConfigurationBuilder.New);
240238
action(result);
241239
return (TConfigurationBuilder)this;
242240
}
243241

244-
public virtual TConfigurationBuilder WithDeploymentMode(DeploymentMode? value)
242+
public TConfigurationBuilder WithDeploymentMode(DeploymentMode? value)
245243
{
246244
this.versioningMode = value;
247245
return (TConfigurationBuilder)this;
248246
}
249247

250-
public virtual TConfigurationBuilder WithLabel(string? value)
248+
public TConfigurationBuilder WithLabel(string? value)
251249
{
252250
this.label = value;
253251
return (TConfigurationBuilder)this;
254252
}
255253

256-
public virtual TConfigurationBuilder WithIncrement(IncrementStrategy value)
254+
public TConfigurationBuilder WithIncrement(IncrementStrategy value)
257255
{
258256
this.increment = value;
259257
return (TConfigurationBuilder)this;
260258
}
261259

262-
public virtual TConfigurationBuilder WithPreventIncrementOfMergedBranch(bool? value)
260+
public TConfigurationBuilder WithPreventIncrementOfMergedBranch(bool? value)
263261
{
264262
this.preventIncrementOfMergedBranch = value;
265263
return (TConfigurationBuilder)this;
266264
}
267265

268-
public virtual TConfigurationBuilder WithPreventIncrementWhenBranchMerged(bool? value)
266+
public TConfigurationBuilder WithPreventIncrementWhenBranchMerged(bool? value)
269267
{
270268
this.preventIncrementWhenBranchMerged = value;
271269
return (TConfigurationBuilder)this;
272270
}
273271

274-
public virtual TConfigurationBuilder WithPreventIncrementWhenCurrentCommitTagged(bool? value)
272+
public TConfigurationBuilder WithPreventIncrementWhenCurrentCommitTagged(bool? value)
275273
{
276274
this.preventIncrementWhenCurrentCommitTagged = value;
277275
return (TConfigurationBuilder)this;
278276
}
279277

280-
public virtual TConfigurationBuilder WithTrackMergeTarget(bool? value)
278+
public TConfigurationBuilder WithTrackMergeTarget(bool? value)
281279
{
282280
this.trackMergeTarget = value;
283281
return (TConfigurationBuilder)this;
284282
}
285283

286-
public virtual TConfigurationBuilder WithTrackMergeMessage(bool? value)
284+
public TConfigurationBuilder WithTrackMergeMessage(bool? value)
287285
{
288286
this.trackMergeMessage = value;
289287
return (TConfigurationBuilder)this;
290288
}
291289

292-
public virtual TConfigurationBuilder WithCommitMessageIncrementing(CommitMessageIncrementMode? value)
290+
public TConfigurationBuilder WithCommitMessageIncrementing(CommitMessageIncrementMode? value)
293291
{
294292
this.commitMessageIncrementing = value;
295293
return (TConfigurationBuilder)this;
296294
}
297295

298-
public virtual TConfigurationBuilder WithRegularExpression(string? value)
296+
public TConfigurationBuilder WithRegularExpression(string? value)
299297
{
300298
this.regularExpression = value;
301299
return (TConfigurationBuilder)this;
302300
}
303301

304-
public virtual TConfigurationBuilder WithTracksReleaseBranches(bool? value)
302+
public TConfigurationBuilder WithTracksReleaseBranches(bool? value)
305303
{
306304
this.tracksReleaseBranches = value;
307305
return (TConfigurationBuilder)this;
308306
}
309307

310-
public virtual TConfigurationBuilder WithIsReleaseBranch(bool? value)
308+
public TConfigurationBuilder WithIsReleaseBranch(bool? value)
311309
{
312310
this.isReleaseBranch = value;
313311
return (TConfigurationBuilder)this;
314312
}
315313

316-
public virtual TConfigurationBuilder WithIsMainBranch(bool? value)
314+
public TConfigurationBuilder WithIsMainBranch(bool? value)
317315
{
318316
this.isMainBranch = value;
319317
return (TConfigurationBuilder)this;
320318
}
321319

322-
public virtual TConfigurationBuilder WithPreReleaseWeight(int? value)
320+
public TConfigurationBuilder WithPreReleaseWeight(int? value)
323321
{
324322
this.preReleaseWeight = value;
325323
return (TConfigurationBuilder)this;
326324
}
327325

328-
public virtual TConfigurationBuilder WithConfiguration(IGitVersionConfiguration value)
326+
public TConfigurationBuilder WithConfiguration(IGitVersionConfiguration value)
329327
{
330328
WithAssemblyVersioningScheme(value.AssemblyVersioningScheme);
331329
WithAssemblyFileVersioningScheme(value.AssemblyFileVersioningScheme);

src/GitVersion.Configuration/ConfigurationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private IGitVersionConfiguration ProvideConfiguration(string? configFile,
7373
}
7474
}
7575

76-
private IReadOnlyDictionary<object, object?>? ReadOverrideConfiguration(string? configFilePath)
76+
private Dictionary<object, object?>? ReadOverrideConfiguration(string? configFilePath)
7777
{
7878
if (configFilePath == null)
7979
{

0 commit comments

Comments
 (0)