Switch to elevate warning to errors
See original GitHub issueSummary of the new feature
As a user, I want a single switch to elevate warnings to errors so that my repos can have error-less, warning-less code. In CI scenarios, like @justinGrote’s Super-Duper-Linter I need the task to fail when there are only warnings.
Proposed technical implementation details (optional)
@rjmholt mentioned the -NoExit
param but I’m not sure if that will exit on warnings as well…
What is the latest version of PSScriptAnalyzer at the point of writing
1.19
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
visual studio - Warning as error - How to get rid of these
Right-click on your project, select "Properties". Click "Build". Switch "Treat warnings as errors" from "All" to "Specific warnings" or "None".
Read more >C# Compiler Options to report errors and warnings
C# Compiler Options for errors and warnings. These options suppress or enable warnings, and control warnings as errors.
Read more >2.1.3.3. Promoting Critical Warnings to Errors
In the Message dialog box, right-click on the critical warning you want to promote to an error. · Click Message Promotion > Promote...
Read more >Warning control — Python 3.11.4 documentation
The warnings filter controls whether warnings are ignored, displayed, or turned into errors (raising an exception). Conceptually, the warnings filter maintains ...
Read more >0.11 — Configuring your compiler: Warning and error levels
To increase your warning levels, right click on your project name in the Solution Explorer window, then choose Properties:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The
-EnableExit
switch returns an exit code equivalent to the number of diagnostic records, no matter the severity. There is also a Severity parameter to run only rules of one or more severities. Even after that one could still easily write some logic to return a different exit code based on analysis of the returned DiagnosticRecords. Therefore I don’t understand the ask here. Maybe you could explain your example in more detail please?@TylerLeonhardt fyi the linter will be able to set a fail level (info, warning, error) based on the diagnostic record output so it won’t be explicitly needed for the linter but still a nice-to-have.