Skip to content

Conversation

@OsirisTerje
Copy link
Member

@OsirisTerje OsirisTerje commented Nov 13, 2025

Fixed all warning in snippets project

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes build warnings in the NUnit documentation snippet projects by adding warning suppressions and cleaning up unnecessary using statements. The main changes include adding NoWarn configurations to suppress NUnit analyzer warnings, adding targeted pragma directives for nullability warnings, reformatting XML indentation, and removing redundant using statements that are covered by implicit usings.

  • Added NoWarn configuration to suppress NUnit analyzer warnings (NUnit2007, NUnit2009, CS7022) at the project level
  • Added targeted pragma directives to suppress specific warnings in test code examples
  • Removed redundant explicit using statements now covered by implicit usings
  • Reformatted XML indentation in project files for consistency

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
docs/snippets/Snippets.NUnitLite/Snippets.NUnitLite.csproj Added NoWarn configuration for analyzer warnings and reformatted XML indentation
docs/snippets/Snippets.NUnit/Snippets.NUnit.csproj Added NoWarn configuration for analyzer warnings and reformatted XML indentation
docs/snippets/Snippets.NUnit/ConstraintExamples.cs Added pragma directives to suppress NUnit2007 and NUnit2009 warnings
docs/snippets/Snippets.NUnit/ClassicAssertExamples.cs Removed redundant using statements, added multiple pragma directives to suppress nullability and NUnit analyzer warnings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@OsirisTerje
Copy link
Member Author

@SeanKilleen I haven't touched the files the markdown linter complains about now.

@SeanKilleen
Copy link
Member

@OsirisTerje I'll fix this shortly. I think the issue is that I'm probably using latest rather than pinning to a version, and they likely added a new rule that we don't care about. Will investigate and fix ASAP.

@mikkelbu
Copy link
Member

When the linter was successful it was running version markdownlint-cli2 v0.18.1 (markdownlint v0.38.0) and now markdownlint-cli2 v0.19.0 (markdownlint v0.39.0)

Compare

Run markdownlint-cli2 --config ".github/linters/.markdownlint.yml" "docs/**/*.md"
  markdownlint-cli2 --config ".github/linters/.markdownlint.yml" "docs/**/*.md"
  shell: /usr/bin/bash -e {0}
  env:
    NUNIT_VERSION_FOR_API_DOCS: 4.4.0
markdownlint-cli2 v0.18.1 (markdownlint v0.38.0)
Finding: docs/**/*.md
Linting: 386 file(s)
Summary: 0 error(s)

vs

Run markdownlint-cli2 --config ".github/linters/.markdownlint.yml" "docs/**/*.md"
  markdownlint-cli2 --config ".github/linters/.markdownlint.yml" "docs/**/*.md"
  shell: /usr/bin/bash -e {0}
  env:
    NUNIT_VERSION_FOR_API_DOCS: 4.4.0
markdownlint-cli2 v0.19.0 (markdownlint v0.39.0)
Finding: docs/**/*.md
Linting: 386 file(s)
Summary: 528 error(s)
...

@SeanKilleen
Copy link
Member

@mikkelbu yes, as I noted, it likely added a new rule that we need to disable.

I will fix this up.

Copy link
Member

@SeanKilleen SeanKilleen left a comment

Choose a reason for hiding this comment

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

👍 Approved and build fixed

@SeanKilleen SeanKilleen merged commit c5193e7 into master Nov 13, 2025
7 checks passed
@SeanKilleen SeanKilleen deleted the snippets branch November 13, 2025 21:51
github-actions bot pushed a commit that referenced this pull request Nov 13, 2025
Co-authored-by: Sean Killeen <[email protected]> c5193e7
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.

4 participants