Is your feature request related to a problem? Please describe.
It might be desirable to only output high severity reports
|
/// The super class for all diagnostics. |
|
/// concret diagnostic types are defined in Diagnostic*.inc |
|
class Diagnostic : public PartialDiagnostic { |
|
public: |
|
/// Each diagnostic contains a severity field, |
|
/// should be "Fatal", "Error" or "Warning" |
|
/// this will affect the eval process. |
|
/// |
|
/// "Warning" -- just a warning. |
|
enum Severity { |
|
/// shouldn't eval the code, e.g. parsing error. |
|
DS_Fatal, |
|
/// trigger an error in nix, but we can recover & eval the code. |
|
DS_Error, |
|
/// A warning. |
|
DS_Warning, |
|
/// An information. |
|
DS_Info, |
|
|
|
/// A hint. Hints are usually not rendered directly in some editor GUI |
|
/// So this is suitable for liveness analysis results. |
|
/// For example, "unused xxx" |
|
DS_Hint, |
|
}; |
Currently, nixf-tidy does not have a way to specify the minimum severity to output
Describe the solution you'd like
A flag --severity <SEVERITY> in nixf-tidy to enable it to output reports above a provided security threshold
The <SEVERITY> argument should be a valid enum Severity value :
|
/// The super class for all diagnostics. |
|
/// concret diagnostic types are defined in Diagnostic*.inc |
|
class Diagnostic : public PartialDiagnostic { |
|
public: |
|
/// Each diagnostic contains a severity field, |
|
/// should be "Fatal", "Error" or "Warning" |
|
/// this will affect the eval process. |
|
/// |
|
/// "Warning" -- just a warning. |
|
enum Severity { |
|
/// shouldn't eval the code, e.g. parsing error. |
|
DS_Fatal, |
|
/// trigger an error in nix, but we can recover & eval the code. |
|
DS_Error, |
|
/// A warning. |
|
DS_Warning, |
|
/// An information. |
|
DS_Info, |
|
|
|
/// A hint. Hints are usually not rendered directly in some editor GUI |
|
/// So this is suitable for liveness analysis results. |
|
/// For example, "unused xxx" |
|
DS_Hint, |
|
}; |
To keep backward compatibility and sane defaults, the default <SEVERITY> should be the minimum, which would output every reports (currently, DS_Hint)
Describe alternatives you've considered
No response
Additional context
Is your feature request related to a problem? Please describe.
It might be desirable to only output high severity reports
nixd/libnixf/include/nixf/Basic/Diagnostic.h
Lines 145 to 168 in 0e07c08
Currently,
nixf-tidydoes not have a way to specify the minimum severity to outputDescribe the solution you'd like
A flag
--severity <SEVERITY>innixf-tidyto enable it to output reports above a provided security thresholdThe
<SEVERITY>argument should be a validenum Severityvalue :nixd/libnixf/include/nixf/Basic/Diagnostic.h
Lines 145 to 168 in 0e07c08
To keep backward compatibility and sane defaults, the default
<SEVERITY>should be the minimum, which would output every reports (currently,DS_Hint)Describe alternatives you've considered
No response
Additional context
--ciflag #840