Skip to content

Commit

Permalink
Fix comment for clear
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Jul 20, 2024
1 parent f8c2cd8 commit d53a015
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}

var outputDir = Path.Combine("Immutype", "Bin", configuration);
var defaultVersion = NuGetVersion.Parse(Property.Get("version", "1.0.0-dev", Tools.UnderTeamCity));
var defaultVersion = NuGetVersion.Parse(Props.Get("version", "1.0.0-dev"));
var nuGetVersion = Version.GetNext(new NuGetRestoreSettings(packageId).WithPackageType(NuGetPackageType.Tool), defaultVersion);
var packages = new List<string>();
foreach (var settings in buildSettings)
Expand Down Expand Up @@ -62,7 +62,7 @@
var teamCityWriter = GetService<ITeamCityWriter>();
teamCityWriter.PublishArtifact($"{mergedPackage} => .");

var apiKey = Property.Get("apiKey", "");
var apiKey = Props.Get("apiKey", "");
if (!string.IsNullOrWhiteSpace(apiKey) && nuGetVersion.Release != "dev")
{
new DotNetNuGetPush()
Expand Down
24 changes: 0 additions & 24 deletions Build/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,4 @@ public static NuGetVersion GetNext(NuGetRestoreSettings settings, NuGetVersion d
: new NuGetVersion(i.Major, i.Minor, i.Patch + 1))
.Max() ?? defaultVersion;
}
}

static class Property
{
public static string Get(string name, string defaultProp, bool showWarning = false)
{
if (Props.TryGetValue(name, out var prop) && !string.IsNullOrWhiteSpace(prop))
{
WriteLine($"{name}: {prop}", Color.Highlighted);
return prop;
}

var message = $"The property \"{name}\" was not defined, the default value \"{defaultProp}\" was used.";
if (showWarning)
{
Warning(message);
}
else
{
Info(message);
}

return defaultProp;
}
}
2 changes: 1 addition & 1 deletion Immutype/Core/MethodWithFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public IEnumerable<MethodDeclarationSyntax> Create(GenerationContext<TypeDeclara
yield return _commentsGenerator.AddComments(
$"Clear <c>{_nameService.ConvertToName(currentParameter.Identifier.Text)}</c>.",
currentParameter,
$"<c>{_nameService.ConvertToName(currentParameter.Identifier.Text)}</c> to be changed in the copy of the instance.",
"",
_syntaxNodeFactory.CreateExtensionMethod(targetType, $"Clear{name}" + targetDeclaration.TypeParameterList)
.AddParameterListParameters(thisParameter)
.WithConstraintClauses(targetDeclaration.ConstraintClauses)
Expand Down
2 changes: 1 addition & 1 deletion Immutype/Immutype.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<!-- Should be compatible with .NET 5.0.102+ and Visual Studio 16.8+ -->
<!-- https://github.com/dotnet/roslyn/blob/main/docs/wiki/NuGet-packages.md#versioning -->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.3.1" PrivateAssets="all" />
<PackageReference Include="Pure.DI" Version="2.1.25">
<PackageReference Include="Pure.DI" Version="2.1.27">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit d53a015

Please sign in to comment.