Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions CS.Changelog.Console/CS.Changelog.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Features>flow-analysis</Features>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<LangVersion>8</LangVersion>
<NoWarn></NoWarn>
<Authors>Robert Sirre, Mario Puglisi</Authors>
<Owner>Cohelion</Owner>
Expand All @@ -17,14 +16,16 @@
<Description>
A git-commit based changelog generator.
</Description>
<Version>1.4.0</Version>
<Copyright>Cohelion 2023</Copyright>
<Version>1.6.0</Version>
<Copyright>Cohelion 2024</Copyright>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Cohelion/CS.Changelog</PackageProjectUrl>
<RepositoryUrl>https://github.com/Cohelion/CS.Changelog</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageReleaseNotes>
<![CDATA[
1.6.0 : Upgraded to .Net 9.0
1.5.0 : Upgraded to .Net 8.0
1.4.0 : Upgraded to .Net 7.0
1.3.5 : Escaped nullreference exceptions, upgraded dependencies.
1.3.4 : Added input validation for urls.
Expand All @@ -43,8 +44,8 @@
</PackageReleaseNotes>
<ApplicationIcon />
<StartupObject />
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackAsTool>false</PackAsTool>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackAsTool>True</PackAsTool>
<ToolCommandName>changelog</ToolCommandName>
<PackageTags>git changelog generator</PackageTags>
<NeutralLanguage>en</NeutralLanguage>
Expand All @@ -54,6 +55,8 @@
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<DebugType>embedded</DebugType>
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<PackageId>RobertSirre.Changelog.Console</PackageId>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Tool'">
Expand Down
8 changes: 4 additions & 4 deletions CS.Changelog.Console/Options.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using CommandLine;
using CommandLine.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using CommandLine;

namespace CS.Changelog.Console
{
Expand Down Expand Up @@ -80,7 +79,8 @@ namespace CS.Changelog.Console
/// </code>
/// </summary>
[SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Option names follow naming conventions for command-line input")]
public class Options
[SuppressMessage("Maintainability", "CA1515:Consider making public types internal", Justification = "These options are parsed from oublic input.")]
public sealed class Options
{
/// <summary>Gets or sets the path to git.</summary>
/// <value>The path to git, defaults to <c>git</c>.</value>
Expand Down
4 changes: 2 additions & 2 deletions CS.Changelog.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ static void Main(string[] args)
return;

// Validate some more
if (!Uri.TryCreate(_options.IssueTrackerUrl, UriKind.Absolute, out _))
if (!string.IsNullOrEmpty(_options.IssueTrackerUrl) && !Uri.TryCreate(_options.IssueTrackerUrl, UriKind.Absolute, out _))
{
System.Console.Error.WriteLine($"{nameof(Options.IssueTrackerUrl)} : {_options.IssueTrackerUrl} is not a valid url");
return;
}
if (!Uri.TryCreate(_options.CommitDetailsUrl, UriKind.Absolute, out _))
if (!string.IsNullOrEmpty(_options.CommitDetailsUrl) && !Uri.TryCreate(_options.CommitDetailsUrl, UriKind.Absolute, out _))
{
System.Console.Error.WriteLine($"{nameof(Options.CommitDetailsUrl)} : {_options.CommitDetailsUrl} is not a valid url");
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net9.0\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>
12 changes: 6 additions & 6 deletions CS.Changelog.Tests/CS.Changelog.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
<Features>flow-analysis</Features>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -18,17 +18,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageReference Include="Xunit.SkippableFact" Version="1.5.23" />

</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion CS.Changelog/CS.Changelog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Markdig.Signed" Version="0.33.0" />
<PackageReference Include="Markdig.Signed" Version="0.38.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion CS.Changelog/Parsing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public static string CleanMessage(string message, Regex IssueFormat)
// Because the end of the message will be changed if there's any issue number present in the
if (message.EndsWith('\r')) message = message.Remove(message.Length - 1, 1);

if (matches.Any())
if (matches.Count > 0)
{
// If multiple matches are found, then leave the message as is
if (matches.Count > 1) return result;
Expand Down