martinmoene / optional-lite

optional lite - A C++17-like optional, a nullable object for C++98, C++11 and later in a single-file header-only library
Boost Software License 1.0
403 stars 45 forks source link

conform to clang-tidy checks #40

Closed mabraham closed 5 years ago

mabraham commented 5 years ago

Currently optional-lite emits many warnings with useful checkers enabled in clang-tidy. Adoption of optional-lite in code bases also using clang-tidy is currently inconvenient because clang-tidy has no way of unilaterally suppressing warnings from the content of the header (although it can do a source file).

As we intend to adopt optional-lite in https://github.com/gromacs/gromacs, we have suppressed many of these, e.g. https://gerrit.gromacs.org/c/gromacs/+/9273/9/src/gromacs/compat/optional.h#207. However we'd like to contribute the improvements so others can benefit, and minimize our cost of upgrading to any future versions.

Is there interest in accepting contributed changes to address such warnings?

Some like https://gerrit.gromacs.org/c/gromacs/+/9273/9/src/gromacs/compat/optional.h#1321 are probably best fixed by e.g. introducing the suggested parentheses, which avoids the noisy NOLINT and NOLINTNEXTLINE comments.

Some warnings might not be worth the cost of suppression/fixing, and we'll happily handle those in our bundled version.