Skip to content

cpplint.py: disable obsolete warnings for c++11 and c++14 features #14320

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 18 commits into from
Jan 13, 2025

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Jan 8, 2025

This PR removes c++11 and c++14 lint checks, as the floor is c++14 (and has been for almost 2 years, since the merge of #10651). cpplint.py appears to have been written pre-c++11 and has not been updated to fully accept c++11 and c++14 features.

This change will improve the readability of code in this repo by removing the need to unnecessarily sprinkle comments like // NOLINT(build/c++11) all over the place.

This PR makes the following changes to cpplint.py:

  • Removes all checks for "approved" c++11 and c++14 headers; all such headers are now "approved".
  • Relaxes the prohibition of using namespace declarations to allow for such declarations for the purpose of bringing custom literals into scope, a case where using namespace declarations are generally accepted.
  • Removes usage of the obsolete-and-soon-to-be-deleted sre_compile Python module.

#no-changelog

…been since #10651 which was merged almost 2 years ago)
@dconeybe dconeybe self-assigned this Jan 8, 2025
…ting custom literals.

For example, the standard library encourages "using namespace" like:

```
using namespace std::literals::chrono_literals (since C++14)
using namespace std::literals::complex_literals (since C++14)
using namespace std::literals::string_literals (since C++14)
using namespace std::literals::string_view_literals (since C++17)
```

so those shouldn't result in lint errors.

See https://en.cppreference.com/w/cpp/symbol_index/literals
@dconeybe dconeybe changed the title cpplint.py: remove c++11 lint checks, as the floor is c++14 (and has … cpplint.py: disable obsolete warnings for c++11 and c++14 features Jan 10, 2025
@dconeybe dconeybe requested a review from paulb777 January 10, 2025 05:51
@dconeybe dconeybe merged commit b756d39 into main Jan 13, 2025
24 checks passed
@dconeybe dconeybe deleted the dconeybe/RemoveCpp11LintChecks branch January 13, 2025 22:23
@firebase firebase locked and limited conversation to collaborators Feb 13, 2025
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants