Skip to content
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

Support for ignoring warning #126

Open
drodil opened this issue Feb 23, 2018 · 2 comments · May be fixed by #162
Open

Support for ignoring warning #126

drodil opened this issue Feb 23, 2018 · 2 comments · May be fixed by #162

Comments

@drodil
Copy link

drodil commented Feb 23, 2018

There should be possibility to ignore warnings with some comment in code for example:

// NOCLEAN
#include "not_needed_header.h"

This would help with false-positives until the other issues are fixed.

@JoelLefkowitz
Copy link

This wonderful packages gets a lot of use from the c++ community and it's been quite some time since this has been requested. There have even been a few SO posts asking for this feature:

I will put in a PR for this feature today. OP suggested it can be used to silence false positives. Most of the issues at the time are now resolved. It is nonetheless a helpful feature for development and for some design conventions that appear to linting tools as being redundant. For example some developers include a *.tpp file inside a header to separate a template definition from its implementation.

I suggest we use similar syntax to other tools such as eslint:

// cppclean-disable

The minimum requirements for this feature are:

// 1. Disable for a whole file
// cppclean-disable

// 2. Disable for a single line
// cppclean-disable-next-line

Additions that will be nice in the future are:

// 3. Support block style comments
/* cppclean-disable-next-line */

// 4. Re-enable after a block
// cppclean-disable
// cppclean-enable

// 5. Disable selected rules only
// cppclean-disable already-included

// 6. Re-enable a subset of selected rules
// cppclean-disable already-included, static-data
// cppclean-enable already-included

@JoelLefkowitz
Copy link

PR in #162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants