How to error rather than warning on specific rule - swiftlint

I want the build to error out on trailing_whitespace. I have added trailing_whitespace: error to my .swiftlint.yml but it's still just showing up as a warning.
I've seen How to force error on SwiftLint instead of warnings? but that's about treating all warnings as errors, I want just selectively treat some rules as errors.

This works in your .swiftlint.yml file:
trailing_whitespace:
severity: error

Related

Cppcheck not able to suppress errors on a symbol during preprocessing stage

Cppcheck reports syntaxError on the following code:
#define DEF_VAR(NAME,ADDR) _symbol NAME ADDR
DEF_VAR(nice_name, 0x00)
Output:
Checking test.h ...
test.h:5:1: error: syntax error [syntaxError]
DEF_VAR(nice_name, 0x00)
^
I stepped into the source code and it turned out to be that the syntax error was due to missing ';' at the end, therefore an exception was raised during preprocessing(simplifyTokens). It doesn't pass the symbol name (DEF_VAR) to the error message, so errors on this symbol will not be suppressed.
And I cannot define a rule to make it a different severity because it happens during preprocessing.
The only way I currently found working was adding inline suppression (too many of them) or suppressing the error for the whole file (other errors in the file will be suppressed, too).
My questions:
Is it the intention that symbol name is not passed to the error message during preprocessing so that it is not supposed to be suppressed? If yes why?
What would be the best why to suppress this error? (This is a compiler specific syntax)

C4714 as an error in CLI project, Release only

I have a __forceinline function that cannot be inlined when compiled as CLI (probably due to the specific restrictions to inlining that apply with .NET).
In debug, it is a warning and does not prevent me from building. But in release, it comes up as an error:
error C4714: function '...' marked as __forceinline not inlined
In the project configuration, Treat Warnings As Errors is set to No (/WX-), Treat Specific Warnings As Errors is empty (no value and no inherited value) and there is no /We option in the Command Line of the C/C++ section.
Thus, I don't understand why this warning comes up as an error.
And as it is an error it prevents me from building the project in release.
Do you have any clue on why this comes up as an error?
Any idea of how I could get rid of it, considering I cannot change the function nor its use (it comes from a library I'm using and I'd like not to alter)?
Thank you very much!

Clang RecursiveASTVisitor warning message?

When running my RecursiveASTVisitor program on Objective C codes, I keep getting this warning warning: unknown warning option '-Wno-receiver-is-weak'; did you mean '-Wno-receiver-expr'? [-Wunknown-warning-option]
But I didn't compile it with warnings enabled or have any warning options within my code.
Where does the error warning come from and how can I disable it?

cc1plus: some warnings being treated as errors

In system:
Fedora 21
Ruby 2.1.7
GCC 4.9.2
I follow the instructions for installing simstring but afer
$ruby extconf.rb
when trying to make and make install, I got an error:
cc1plus: some warnings being treated as errors
Makefile:217: recipe for target 'export_wrap.o' failed
make: *** [export_wrap.o] Error 1
And the entire log of this error is bellow
Error Log
I searched about this error but all of replies are about how to disable Werrors and configure with ignoring werrors.
Is there any solution?I think something not mentioned but i don't know what..
I searched about this error
That's not an error. It's a notification. It notifies that some warnings have been treated as errors.
I searched about this error but all of replies are about how to disable Werrors and configure with ignoring werrors. Is there any solution?
You answered your own question. If the source code of the program generates warnings, and if the compiler is asked to treat warnings as errors, then the compiler will refuse to compile the program. Complete list of possible solutions are:
Fix the source code to not generate warnings. This is a very good idea.
Stop asking the compiler to treat warnings as errors (this is the solution that you already found). You should still fix the code to not generate a warning.
Ask the compiler to ignore the warnings entirely. This is usually a bad idea unless you understand the warning and know what you're doing.

Suppressing Compiler Warning C++

I'm getting a compile-time error. It complains that I'm initializing a variable, but not referencing it. What's happening is that I initialize it then make a debug print statement that only get's compiled in for a debug build but not a release build. The error in question is warning c4189 (it's treated as an error and won't compile).
Is it possible to suppress this warning? How about warnings in general?
Don't suppress the warning, fix it! Wrap the declaration and initialization of the variable so it only exists in a debug build too.