Skip to content

First version#10

Merged
HaGGi13 merged 17 commits intomainfrom
develop
Feb 22, 2026
Merged

First version#10
HaGGi13 merged 17 commits intomainfrom
develop

Conversation

@HaGGi13
Copy link
Copy Markdown
Owner

@HaGGi13 HaGGi13 commented Feb 22, 2026

No description provided.

Implemented the class `DurationTimeParser`, which provides methods to
parse formatted duration strings into `TimeSpan`.
Added extensive unit tests to validate functionality.
This fixed the SonarQube issue csharpsquid:S1192 - String literals should not be duplicated.
Fix SonarQube code coverage detection

The code coverage reports were necessary to name with the
`CoverletOutput` parameter, otherwise files were generated starting with
`TestResults` whereby this is should be the directory and not part of
the code coverage report file name.
In addition, the SonarQube prepare step was updated to point SonarQube
to the correct coverage report files. Because this library is targets
multiple frameworks, each of its test runs creates a dedicated code
coverage report file, hence a wildcard (asterisk) was necessary to used
to tell SonarQube to fetch all of those files and merge them by itself.
Optimize and speedup build runs

Switched to the Ubuntu runner, because the Windows runner needs much
more time in setting it up and there're no dependencies which would a
Windows require for building.

In addition the SonarQube setup was simplify to avoid relative paths for
running the sonar scanner. This should result a little speed up too.
Furthermore, the build configuration was optimized by using the artifact
upload action v4 instead of v6 which requires Node.js and not letting
any command run in PowerShell, because the bash is by default available
on an Ubuntu runner.

As well a SonarQube marked security issue
[Avoid expanding secrets in run block
(githubactions:S7636)](https://next.sonarqube.com/sonarqube/coding_rules?open=githubactions%3AS7636&rule_key=githubactions%3AS7636)
was fixed
by providing the SonarQube token as pipeline environment variable
instead of expanding it during runtime.
Add benchmarking project for `DurationTimeParser`

Introduced a new `DurationMancer.Benchmarks` project utilizing
BenchmarkDotNet for performance benchmarking.
Added various benchmarks for standard, human-readable, and edge-case
duration formats.
Excluded the benchmarks project in general and for SonarQube from
code coverage reports and analysis.
Added a GitHub Actions workflow to automate benchmarking runs using
BenchmarkDotNet.
Updated the README to include benchmark results for various .NET
versions and duration parsing scenarios.
Added benchmark results for .NET versions and parsing scenarios to
README file.
Optimize regex usage + improve parsing performance

Removed redundant `RegexOptions.Compiled` flag from the `GeneratedRegex`
attribute because the source generator produces by default an already
optimized RegEx at compile time.
Replaced `.Value` with `.ValueSpan` to minimize string allocation and
enhance performance during parsing.
Cached frequently accessed `Group` instances to avoid redundant lookups.
Updated exception handling in parsing methods to specify relevant
exceptions (`FormatException` and `OverflowException`).

Improved README formatting and grammar.
Added usage examples for both human-readable and standard duration
formats.
Updated benchmark results to reflect changes in performance.
Add `Parse` method to `DurationTimeParser`

Introduced a `Parse` method to validate and convert input strings to
`TimeSpan`, throwing relevant exceptions (`ArgumentNullException`,
`FormatException`) for invalid cases.
This method was introduced for not passive coding approaches to satisfy
this possible need of developers too.

Added comprehensive unit tests to cover the new method `Parse`
functionality. To avoid input value redundancy and enhance reusability,
all values were extracted to use-case dedicated classes.

Extend benchmarks

Furthermore, benchmarks for the method `Parse` were added.

In addition, the usage examples in the README file were fixed and a
reference to the Benchmark page in the Wiki added. The later was done to
keep the README small and focused on the easy get started.

Added benchmarks for the new method `Parse` and hide not needed columns
"Job" and "Alloc Ratio" in results.
Remove empty test class and add badges to README

Removed an unused, empty test class from the codebase to improve
clarity.
Updated the `README` file by adding relevant badges for project status
and metrics.
Exclude benchmarks project from rider code coverage
Added a release pipeline to automate NuGet package publishing. This
workflow handles versioning, building, testing, packaging, and
publishing to NuGet.org, as well as creating a GitHub Releases with
relevant artifacts.
Adjusted branch triggers in the build workflow to include `main`,
`release/*`, and `develop` branches for both pushes and pull requests.
Enable symbol package generation (#12)

Added `IncludeSymbols` and `SymbolPackageFormat` properties to
`Directory.Build.props` to enable generation of `.snupkg` symbol
packages for better debugging and NuGet symbol support.
@HaGGi13 HaGGi13 self-assigned this Feb 22, 2026
@HaGGi13 HaGGi13 merged commit 170bbaf into main Feb 22, 2026
7 checks passed
@HaGGi13 HaGGi13 deleted the develop branch February 22, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant