Skip to content

Frends.JSON.Handlebars: compliance fixes — net8, static class, Options param, Error result - #42

Open
MichalFrends1 with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-compliance-findings-in-frends-json-handlers
Open

Frends.JSON.Handlebars: compliance fixes — net8, static class, Options param, Error result#42
MichalFrends1 with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-compliance-findings-in-frends-json-handlers

Conversation

Copilot AI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Resolves task analyzer findings (FT0004, FT0007, FT0011), upgrades target framework to net8.0, and adds standard error-handling support.

Changes

  • net8.0 — Both main and test projects retargeted from net6.0
  • Static class (FT0004) — JSON class is now static
  • Options parameter (FT0007) — New Options class added; Handlebars() now accepts it as a [PropertyTab] parameter with ThrowErrorOnFailure (default true) and ErrorMessageOnFailure
  • Error property on Result (FT0011) — New Error class (Message, AdditionalInfo); Result gains an Error property populated on failure
  • ErrorHandler helperHelpers/ErrorHandler.cs with standard ex.Handle(options) extension; main method body wrapped in try/catch
  • Version bumped to 1.3.0

Updated call signature

// Before
JSON.Handlebars(input, cancellationToken)

// After
JSON.Handlebars(input, options, cancellationToken)

Error handling behavior

var options = new Options { ThrowErrorOnFailure = false };
var result = JSON.Handlebars(input, options, ct);
// result.Success == false, result.Error.Message contains the reason

Co-authored-by: MichalFrends1 <167774394+MichalFrends1@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compliance findings in Frends.JSON.Handlebars Frends.JSON.Handlebars: compliance fixes — net8, static class, Options param, Error result Aug 5, 2026
Copilot AI requested a review from MichalFrends1 August 5, 2026 06:29
@MichalFrends1
MichalFrends1 marked this pull request as ready for review August 5, 2026 06:50
using System;
using System.Threading;
using Frends.JSON.Handlebars.Definitions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use nunit for new tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — ErrorHandlerTests.cs now uses NUnit ([TestFixture], [Test], Assert.That). NUnit and NUnit3TestAdapter packages added to the test project.

}
} No newline at end of file

internal Result() { }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are not using this one - remove if not needed, or explain why we need this constructor

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed. The ErrorHandler now uses new Result(false, null) { Error = ... } with the existing parametered constructor, so the parameterless one was not needed.

@MatteoDelOmbra MatteoDelOmbra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot resolve review comments

…esult constructor

Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
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.

3 participants