Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .github/agents/test-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ Common anti-patterns to avoid (not exhaustive):
// ✅ Good: Assert.HasCount(3, collection);
```

5. **Avoid Assert.IsTrue for string prefix checks** - Use `Assert.StartsWith` instead of wrapping
`string.StartsWith` in `Assert.IsTrue`, as it produces clearer failure messages that show the expected prefix
and actual value:

```csharp
// ❌ Bad: Assert.IsTrue(value.StartsWith("prefix"));
// ✅ Good: Assert.StartsWith("prefix", value);
```

## Defer To

- **Requirements Agent**: For test strategy and coverage requirements
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ updates:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
groups:
github-actions-dependencies:
patterns:
- "*"
22 changes: 11 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ jobs:
--property:PackageVersion=${{ inputs.version }}

- name: Upload Test Results
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.os }}
path: test-results/*.trx

- name: Upload Artifacts
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: artifacts-${{ matrix.os }}
path: |
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
upload: false

- name: Upload CodeQL SARIF
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: codeql-sarif
path: sarif-results/csharp.sarif
Expand All @@ -215,7 +215,7 @@ jobs:
uses: actions/checkout@v6

- name: Download package
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: artifacts-${{ matrix.os }}
path: packages
Expand Down Expand Up @@ -269,13 +269,13 @@ jobs:

- name: Upload validation test results
if: always()
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: validation-test-results-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}
path: validation-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}.trx

- name: Upload version capture
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: version-capture-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}
path: versionmark-int-*.json
Expand All @@ -299,26 +299,26 @@ jobs:
node-version: 'lts/*'

- name: Download all test results
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
path: test-results
pattern: '*test-results*'
continue-on-error: true

- name: Download VersionMark package
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: artifacts-windows-latest
path: packages

- name: Download CodeQL SARIF
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: codeql-sarif
path: codeql-results

- name: Download all version captures
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
path: version-captures
pattern: 'version-capture-*'
Expand Down Expand Up @@ -522,7 +522,7 @@ jobs:
"docs/VersionMark Trace Matrix.pdf"

- name: Upload documentation
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: documents
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ jobs:
10.x

- name: Download package artifacts
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: artifacts-ubuntu-latest
path: artifacts

- name: Download documents artifact
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: documents
path: artifacts
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ Generated documentation includes:

Copyright (c) DEMA Consulting. Licensed under the MIT License. See [LICENSE][link-license] for details.

By contributing to this project, you agree that your contributions will be licensed under the MIT License.

<!-- Badge References -->
[badge-forks]: https://img.shields.io/github/forks/demaconsulting/VersionMark?style=plastic
[badge-stars]: https://img.shields.io/github/stars/demaconsulting/VersionMark?style=plastic
Expand Down
2 changes: 2 additions & 0 deletions src/DemaConsulting.VersionMark/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ private Context()
/// <exception cref="ArgumentException">Thrown when arguments are invalid.</exception>
public static Context Create(string[] args)
{
ArgumentNullException.ThrowIfNull(args);
var parser = new ArgumentParser();
parser.ParseArguments(args);

Expand Down Expand Up @@ -249,6 +250,7 @@ private sealed class ArgumentParser
/// <param name="args">Command-line arguments.</param>
public void ParseArguments(string[] args)
{
ArgumentNullException.ThrowIfNull(args);
int i = 0;
while (i < args.Length)
{
Expand Down
18 changes: 15 additions & 3 deletions src/DemaConsulting.VersionMark/DemaConsulting.VersionMark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<LangVersion>12</LangVersion>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down Expand Up @@ -34,7 +34,7 @@

<!-- Code Quality Configuration -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
Expand All @@ -49,13 +49,25 @@
<ItemGroup>
<PackageReference Include="DemaConsulting.TestResults" Version="1.5.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="10.0.3" />
<!-- PrivateAssets="All" prevents these build-time-only packages from becoming transitive dependencies -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="4.1.5" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.103" PrivateAssets="All" />
<!--
Analyzer and source-only packages require both PrivateAssets and IncludeAssets:
PrivateAssets="all" - prevents these build-time assets from flowing to consumers
IncludeAssets - explicitly enables contentfiles (source injection) and
analyzers/buildtransitive (Roslyn analyzers at compile time)
-->
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.103">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.19.0.132793">
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.20.0.135146">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Polyfill is a source-only package; contentfiles delivers the polyfill source into this project -->
<PackageReference Include="Polyfill" Version="9.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 2 additions & 0 deletions src/DemaConsulting.VersionMark/Validation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ internal static class Validation
/// <param name="context">The context containing command line arguments and program state.</param>
public static void Run(Context context)
{
ArgumentNullException.ThrowIfNull(context);

// Print validation header
PrintValidationHeader(context);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<LangVersion>12</LangVersion>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand All @@ -11,7 +11,7 @@

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -23,10 +23,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="MSTest.TestAdapter" Version="4.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="4.1.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.19.0.132793">
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.20.0.135146">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down