Skip to content

Fix compliance findings in Frends.Pdf.Create (FT0007, FT0011, FT0014, FT0015, FT0018) - #22

Merged
MichalFrends1 merged 7 commits into
mainfrom
copilot/fix-compliance-findings-frends-pdf-create
Aug 19, 2026
Merged

Fix compliance findings in Frends.Pdf.Create (FT0007, FT0011, FT0014, FT0015, FT0018)#22
MichalFrends1 merged 7 commits into
mainfrom
copilot/fix-compliance-findings-frends-pdf-create

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Resolves 18 FrendsTaskAnalyzer findings in Frends.Pdf.Create by aligning the task with current platform standards.

Breaking changes (→ v3.0.0)

Method signature — the three separate [PropertyTab] parameters (FileProperties, DocumentSettings, DocumentContent) were not recognized platform types (FT0018) and Input/CancellationToken were missing (FT0007). They are now consolidated:

// Before
public static Result Create(
    [PropertyTab] FileProperties outputFile,
    [PropertyTab] DocumentSettings documentSettings,
    [PropertyTab] DocumentContent content,
    [PropertyTab] Options options)

// After
public static Result Create(
    [PropertyTab] Input input,
    [PropertyTab] Options options,
    CancellationToken cancellationToken)

Input groups the three former parameters as OutputFile, DocumentSettings, and Content.

Non-breaking additions

  • Options.ErrorMessageOnFailure (FT0015) — allows overriding the thrown/returned error message.
  • Result.Error (FT0011) — populated with message and inner exception when ThrowErrorOnFailure = false.
  • Helpers/ErrorHandler — standard platform pattern; all exceptions in Create() now route through exception.Handle(options) instead of hand-rolled if (ThrowErrorOnFailure) throw.
  • XML docs — added <summary> and <example> to all flagged properties/methods in FontMetadata, Extensions, and FileFontResolver (FT0014).

Project / tooling

  • FrendsTaskMetadata.json changed from <None> to <AdditionalFiles> (required by FrendsTaskAnalyzers for FT0020).
  • Added StyleCop.Analyzers and FrendsTaskAnalyzers package references; added GlobalSuppressions.cs with standard Frends suppressions.

Tests

  • Existing tests updated to the new Input-based call site.
  • Tests that asserted FileNotFoundException updated to Exception — the ErrorHandler wraps all exceptions in new Exception(message, innerEx).
  • ErrorHandlerTest added covering: throw on failure, return failed result, custom error message (throw and return paths).

Copilot AI and others added 2 commits August 17, 2026 10:14
…, FT0014, FT0015, FT0018)

Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
…coverage

Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compliance findings in Frends.Pdf.Create Fix compliance findings in Frends.Pdf.Create (FT0007, FT0011, FT0014, FT0015, FT0018) Aug 17, 2026
Copilot AI requested a review from MatteoDelOmbra August 17, 2026 10:19
Comment thread Frends.Pdf.Create/Frends.Pdf.Create/Definitions/Error.cs Outdated
Comment thread Frends.Pdf.Create/Frends.Pdf.Create/Definitions/Result.cs Outdated
Comment thread Frends.Pdf.Create/Frends.Pdf.Create/GlobalSuppressions.cs
Comment thread Frends.Pdf.Create/Frends.Pdf.Create/Definitions/Input.cs Outdated
Comment thread Frends.Pdf.Create/Frends.Pdf.Create/Definitions/Input.cs Outdated

@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 go through comments and resolve them accordingly

Copilot AI and others added 2 commits August 17, 2026 11:14
….AdditionalInfo type, use parameterless Result constructor, add test GlobalSuppressions

Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
Co-authored-by: MatteoDelOmbra <44415151+MatteoDelOmbra@users.noreply.github.com>
@MatteoDelOmbra
MatteoDelOmbra marked this pull request as ready for review August 17, 2026 11:35
Comment thread Frends.Pdf.Create/Frends.Pdf.Create/Definitions/Options.cs Outdated
@MichalFrends1
MichalFrends1 merged commit d9015de into main Aug 19, 2026
6 checks passed
@MichalFrends1
MichalFrends1 deleted the copilot/fix-compliance-findings-frends-pdf-create branch August 19, 2026 11: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.

3 participants