Skip to content

Commit d8371e1

Browse files
committed
fix some warnings
1 parent c142f2c commit d8371e1

File tree

77 files changed

+231
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+231
-237
lines changed

src/GitTools.Testing/Internal/DirectoryHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ internal static class DirectoryHelper
55
private static readonly Dictionary<string, string> ToRename = new()
66
{
77
{ "gitted", ".git" },
8-
{ "gitmodules", ".gitmodules" },
8+
{ "gitmodules", ".gitmodules" }
99
};
1010

1111
public static void CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target)

src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void SetUp()
2121
services.AddSingleton<IGlobbingResolver, GlobbingResolver>();
2222
services.AddSingleton<ICurrentBuildAgent, MockBuildAgent>();
2323
});
24-
this.argumentParser = sp.GetService<IArgumentParser>();
24+
this.argumentParser = sp.GetRequiredService<IArgumentParser>();
2525
}
2626

2727
[Test]

src/GitVersion.App.Tests/ArgumentParserTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public void SetUp()
2525
services.AddSingleton<IArgumentParser, ArgumentParser>();
2626
services.AddSingleton<IGlobbingResolver, GlobbingResolver>();
2727
});
28-
this.environment = sp.GetService<IEnvironment>();
29-
this.argumentParser = sp.GetService<IArgumentParser>();
28+
this.environment = sp.GetRequiredService<IEnvironment>();
29+
this.argumentParser = sp.GetRequiredService<IArgumentParser>();
3030
}
3131

3232
[Test]
@@ -415,35 +415,35 @@ private static IEnumerable<TestCaseData> OverrideconfigWithSingleOptionTestData(
415415
"assembly-versioning-scheme=MajorMinor",
416416
new Config
417417
{
418-
AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor,
418+
AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor
419419
}
420420
);
421421
yield return new TestCaseData(
422422
"assembly-file-versioning-scheme=\"MajorMinorPatch\"",
423423
new Config
424424
{
425-
AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch,
425+
AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch
426426
}
427427
);
428428
yield return new TestCaseData(
429429
"assembly-informational-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"",
430430
new Config
431431
{
432-
AssemblyInformationalFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}",
432+
AssemblyInformationalFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}"
433433
}
434434
);
435435
yield return new TestCaseData(
436436
"assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"",
437437
new Config
438438
{
439-
AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}",
439+
AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}"
440440
}
441441
);
442442
yield return new TestCaseData(
443443
"assembly-file-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"",
444444
new Config
445445
{
446-
AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}",
446+
AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}"
447447
}
448448
);
449449
yield return new TestCaseData(
@@ -574,7 +574,7 @@ private static IEnumerable<TestCaseData> OverrideconfigWithMultipleOptionsTestDa
574574
new Config
575575
{
576576
TagPrefix = "sample",
577-
AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor,
577+
AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor
578578
}
579579
);
580580
yield return new TestCaseData(

src/GitVersion.App.Tests/HelpWriterTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class HelpWriterTests : TestBase
1313
public HelpWriterTests()
1414
{
1515
var sp = ConfigureServices(services => services.AddModule(new GitVersionAppModule()));
16-
this.helpWriter = sp.GetService<IHelpWriter>();
16+
this.helpWriter = sp.GetRequiredService<IHelpWriter>();
1717
}
1818

1919
[Test]
@@ -32,15 +32,15 @@ public void AllArgsAreInHelp()
3232
{ nameof(Arguments.UpdateWixVersionFile), "/updatewixversionfile" },
3333
{ nameof(Arguments.ConfigFile), "/config" },
3434
{ nameof(Arguments.Verbosity), "/verbosity" },
35-
{ nameof(Arguments.CommitId), "/c" },
35+
{ nameof(Arguments.CommitId), "/c" }
3636
};
3737
string helpText = null;
3838

3939
this.helpWriter.WriteTo(s => helpText = s);
4040

4141
var ignored = new[]
4242
{
43-
nameof(Arguments.Authentication),
43+
nameof(Arguments.Authentication)
4444
};
4545
typeof(Arguments).GetFields()
4646
.Select(p => p.Name)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ params KeyValuePair<string, string>[] environments
4747
{ Jenkins.EnvironmentVariableName, null },
4848
{ AzurePipelines.EnvironmentVariableName, null },
4949
{ GitHubActions.EnvironmentVariableName, null },
50-
{ SpaceAutomation.EnvironmentVariableName, null },
50+
{ SpaceAutomation.EnvironmentVariableName, null }
5151
};
5252

5353
foreach (var environment in environments)

src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async Task VerifyCodeBuildPullRequest(string pullRequestRef)
3434
{
3535
var env = new Dictionary<string, string>
3636
{
37-
{ CodeBuild.WebHookEnvironmentVariableName, PullRequestBranchName },
37+
{ CodeBuild.WebHookEnvironmentVariableName, PullRequestBranchName }
3838
};
3939
await VerifyPullRequestVersionIsCalculatedProperly(pullRequestRef, env);
4040
}
@@ -44,7 +44,7 @@ public async Task VerifyContinuaCIPullRequest(string pullRequestRef)
4444
{
4545
var env = new Dictionary<string, string>
4646
{
47-
{ ContinuaCi.EnvironmentVariableName, "true" },
47+
{ ContinuaCi.EnvironmentVariableName, "true" }
4848
};
4949
await VerifyPullRequestVersionIsCalculatedProperly(pullRequestRef, env);
5050
}
@@ -56,7 +56,7 @@ public async Task VerifyDronePullRequest(string pullRequestRef)
5656
var env = new Dictionary<string, string>
5757
{
5858
{ Drone.EnvironmentVariableName, "true" },
59-
{ "DRONE_PULL_REQUEST", PullRequestBranchName },
59+
{ "DRONE_PULL_REQUEST", PullRequestBranchName }
6060
};
6161
await VerifyPullRequestVersionIsCalculatedProperly(pullRequestRef, env);
6262
}
@@ -67,7 +67,7 @@ public async Task VerifyGitHubActionsPullRequest(string pullRequestRef)
6767
var env = new Dictionary<string, string>
6868
{
6969
{ GitHubActions.EnvironmentVariableName, "true" },
70-
{ "GITHUB_REF", PullRequestBranchName },
70+
{ "GITHUB_REF", PullRequestBranchName }
7171
};
7272
await VerifyPullRequestVersionIsCalculatedProperly(pullRequestRef, env);
7373
}
@@ -78,7 +78,7 @@ public async Task VerifyGitLabCIPullRequest(string pullRequestRef)
7878
var env = new Dictionary<string, string>
7979
{
8080
{ GitLabCi.EnvironmentVariableName, "true" },
81-
{ "CI_COMMIT_REF_NAME", PullRequestBranchName },
81+
{ "CI_COMMIT_REF_NAME", PullRequestBranchName }
8282
};
8383
await VerifyPullRequestVersionIsCalculatedProperly(pullRequestRef, env);
8484
}
@@ -101,7 +101,7 @@ public async Task VerifyMyGetPullRequest(string pullRequestRef)
101101
{
102102
var env = new Dictionary<string, string>
103103
{
104-
{ MyGet.EnvironmentVariableName, "MyGet" },
104+
{ MyGet.EnvironmentVariableName, "MyGet" }
105105
};
106106

107107
await VerifyPullRequestVersionIsCalculatedProperly(pullRequestRef, env);
@@ -112,7 +112,7 @@ public async Task VerifyTeamCityPullRequest(string pullRequestRef)
112112
{
113113
var env = new Dictionary<string, string>
114114
{
115-
{ TeamCity.EnvironmentVariableName, "8.0.0" },
115+
{ TeamCity.EnvironmentVariableName, "8.0.0" }
116116
};
117117
await VerifyPullRequestVersionIsCalculatedProperly(pullRequestRef, env);
118118
}
@@ -123,7 +123,7 @@ public async Task VerifyTravisCIPullRequest(string pullRequestRef)
123123
var env = new Dictionary<string, string>
124124
{
125125
{ TravisCi.EnvironmentVariableName, "true" },
126-
{ "CI", "true" },
126+
{ "CI", "true" }
127127
};
128128
await VerifyPullRequestVersionIsCalculatedProperly(pullRequestRef, env);
129129
}

src/GitVersion.App.Tests/TagCheckoutInBuildAgentTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public async Task VerifyTagCheckoutOnAzurePipelines()
1616
var env = new Dictionary<string, string>
1717
{
1818
{ AzurePipelines.EnvironmentVariableName, "true" },
19-
{ "BUILD_SOURCEBRANCH", "refs/tags/0.2.0" },
19+
{ "BUILD_SOURCEBRANCH", "refs/tags/0.2.0" }
2020
};
2121

2222
await VerifyTagCheckoutVersionIsCalculatedProperly(env);
@@ -28,7 +28,7 @@ public async Task VerifyTagCheckoutOnGitHubActions()
2828
var env = new Dictionary<string, string>
2929
{
3030
{ GitHubActions.EnvironmentVariableName, "true" },
31-
{ "GITHUB_REF", "ref/tags/0.2.0" },
31+
{ "GITHUB_REF", "ref/tags/0.2.0" }
3232
};
3333

3434
await VerifyTagCheckoutVersionIsCalculatedProperly(env);

src/GitVersion.App.Tests/VersionWriterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public VersionWriterTests()
1515
{
1616
var sp = ConfigureServices(services => services.AddModule(new GitVersionAppModule()));
1717

18-
this.versionWriter = sp.GetService<IVersionWriter>();
18+
this.versionWriter = sp.GetRequiredService<IVersionWriter>();
1919
}
2020
[Test]
2121
public void WriteVersionShouldWriteFileVersionWithNoPrereleaseTag()

src/GitVersion.App/ArgumentParser.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public Arguments ParseArguments(string[] commandLineArguments)
3535
{
3636
var args = new Arguments
3737
{
38-
TargetPath = System.Environment.CurrentDirectory,
38+
TargetPath = System.Environment.CurrentDirectory
3939
};
4040

4141
args.Output.Add(OutputType.Json);
@@ -54,23 +54,23 @@ public Arguments ParseArguments(string[] commandLineArguments)
5454
return new Arguments
5555
{
5656
TargetPath = System.Environment.CurrentDirectory,
57-
Init = true,
57+
Init = true
5858
};
5959
}
6060

6161
if (firstArgument.IsHelp())
6262
{
6363
return new Arguments
6464
{
65-
IsHelp = true,
65+
IsHelp = true
6666
};
6767
}
6868

6969
if (firstArgument.IsSwitch("version"))
7070
{
7171
return new Arguments
7272
{
73-
IsVersion = true,
73+
IsVersion = true
7474
};
7575
}
7676

src/GitVersion.App/Arguments.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,34 +57,34 @@ public GitVersionOptions ToOptions()
5757
{
5858
Username = this.Authentication.Username,
5959
Password = this.Authentication.Password,
60-
Token = this.Authentication.Token,
60+
Token = this.Authentication.Token
6161
},
6262

6363
ConfigInfo =
6464
{
6565
ConfigFile = ConfigFile,
6666
OverrideConfig = OverrideConfig,
67-
ShowConfig = ShowConfig,
67+
ShowConfig = ShowConfig
6868
},
6969

7070
RepositoryInfo =
7171
{
7272
TargetUrl = TargetUrl,
7373
TargetBranch = TargetBranch,
7474
CommitId = CommitId,
75-
DynamicRepositoryClonePath = DynamicRepositoryClonePath,
75+
DynamicRepositoryClonePath = DynamicRepositoryClonePath
7676
},
7777

7878
Settings =
7979
{
8080
NoFetch = NoFetch,
8181
NoCache = NoCache,
82-
NoNormalize = NoNormalize,
82+
NoNormalize = NoNormalize
8383
},
8484

8585
WixInfo =
8686
{
87-
ShouldUpdate = UpdateWixVersionFile,
87+
ShouldUpdate = UpdateWixVersionFile
8888
},
8989

9090
Init = Init,

0 commit comments

Comments
 (0)