Ensure that internal code is never exposed through InternalsVisibleTo#54
Merged
dennisdoomen merged 1 commit intomainfrom Aug 17, 2025
Merged
Ensure that internal code is never exposed through InternalsVisibleTo#54dennisdoomen merged 1 commit intomainfrom
dennisdoomen merged 1 commit intomainfrom
Conversation
Pull Request Test Coverage Report for Build 17012518801Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces the Microsoft.CodeAnalysis.Embedded attribute to prevent internal types from being exposed through InternalsVisibleTo declarations, hardening encapsulation boundaries in the Pathy library.
- Applies the
[Microsoft.CodeAnalysis.Embedded]attribute to internal types and classes - Defines a custom
EmbeddedAttributeclass in theMicrosoft.CodeAnalysisnamespace - Updates project configuration to use
PATHY_PUBLICdefine instead ofMYPACKAGE_COMPILE
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Pathy/ChainablePath.cs | Adds EmbeddedAttribute to internal types and defines the attribute class |
| Pathy.Globbing/PathyGlobbing.cs | Applies EmbeddedAttribute to internal extensions class and defines the attribute |
| Pathy.Globbing/Pathy.Globbing.csproj | Changes compile constant from MYPACKAGE_COMPILE to PATHY_PUBLIC |
| Pathy.Specs/ChainablePathSpecs.cs | Removes unused System.Linq import |
| Multiple API verification files | Updates expected public API surface after configuration changes |
| Package reference updates | Updates FluentAssertions, Verify.Xunit, and PackageGuard versions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This was referenced Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR hardens encapsulation so internals can’t leak via
InternalsVisibleTo. It introduces theMicrosoft.CodeAnalysis.Embeddedattribute and applies it tointernaltypes, ensuring they’re embedded and never surface across assembly boundaries even when another assembly is granted internals access.Closes #31