question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switch to elevate warning to errors

See original GitHub issue

Summary 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:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bergmeistercommented, Jul 14, 2020

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?

1reaction
JustinGrotecommented, Jun 28, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found