-
-
Notifications
You must be signed in to change notification settings - Fork 130
Skip absent hook pipelines #6630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: thomhurst/TUnit
Length of output: 46560
🏁 Script executed:
Repository: thomhurst/TUnit
Length of output: 20455
🏁 Script executed:
Repository: thomhurst/TUnit
Length of output: 1345
🌐 Web query:
Microsoft C# compiler warning CS0414 private field assigned but its value is never used TreatWarningsAsErrors💡 Result:
Compiler warning CS0414 ("The private field 'field' is assigned but its value is never used") occurs when a private field in a C# class is given a value—either via an inline initializer or within a constructor—but the field's value is never subsequently read or accessed by any code within the class [1][2]. To treat this warning as an error, you can modify your project file (.csproj) to use the WarningsAsErrors property [3][4]. How to Treat CS0414 as an Error You can configure your project to elevate specific warnings to errors by adding the following to your.csproj file [3][4]: $(WarningsAsErrors);CS0414 Alternatively, if you want to treat all warnings as errors, use the TreatWarningsAsErrors property [3][4]: true Resolving the Warning Before suppressing or elevating the warning, consider the following common causes and resolutions: 1. Dead Code Removal: If the field is truly unnecessary, remove it to improve code clarity and reduce memory usage [1][2]. 2. Logic Implementation: If you intended to use the field for a feature you haven't implemented yet, complete the necessary code to read the field [2][5]. 3. Visibility: If the field needs to be accessed by other classes, consider changing its access modifier to public or internal, or exposing it via a public property [2]. 4. Debugging Artifacts: If the field was only used for temporary debugging, remove it [2]. If you are certain the field is needed (e.g., used for serialization, reflection, or by specific frameworks like Unity), you can suppress the warning locally using a pragma directive [1][6]:
#pragmawarning disable 0414 private int _myField = 1;#pragmawarning restore 0414 Note that CS0414 is a compiler warning that typically only appears during an explicit build or rebuild operation, rather than during real-time IDE analysis [1][7]. If you modify code to fix the issue, you must perform a build to verify that the warning has been cleared [1][7].Citations:
Scope
_finishActivitytoNETtargets.On
netstandard2.0,_finishActivityis assigned but never read.TUnit.Enginetreats warnings as errors, so this causes CS0414 to fail the build.♻️ Proposed fix
internal readonly struct AfterClassCleanup { private readonly HookExecutor _hookExecutor; private readonly CancellationToken _cancellationToken; +#if NET private readonly bool _finishActivity; +#endif private AfterClassCleanup( HookExecutor hookExecutor, CancellationToken cancellationToken, bool finishActivity) { _hookExecutor = hookExecutor; _cancellationToken = cancellationToken; +#if NET _finishActivity = finishActivity; +#endif }📝 Committable suggestion
🤖 Prompt for AI Agents