FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Avoid IWYU False Positives on external libraries by geoffviola · Pull Request #266 · cpplint/cpplint · GitHub

Avoid IWYU False Positives on external libraries - #266

Merged
aaronliu0130 merged 1 commit into
cpplint:developfrom
geoffviola:filter_maybe_template
Mar 20, 2024
Merged

Avoid IWYU False Positives on external libraries#266
aaronliu0130 merged 1 commit into
cpplint:developfrom
geoffviola:filter_maybe_template

Conversation

Copy link
Copy Markdown
Contributor

Follow-up to #217

Here is another try at addressing #27. Instead of only checking against the qualified call (i.e. std::), it also checks against the unqualified call. This change should preserve backward compatibility while preventing false positives for common names in other namespaces.

Here is a quick list of checks

These emit warnings

std::make_pair(1, 2)
std::make_pair(1, 2)
make_pair(1, 2)
auto foo = std::make_pair(1, 2)

These do not emit warnings

boost::make_pair(1, 2)
asdfasdf::make_pair(1, 2)
asdfasdfstd::make_pair(1, 2)
.make_pair(1, 2)

aaronliu0130 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Seems good, although...

  1. The added test case violates IWYU (include-what-you-use), as boost::range::transform isn't included. Regardless, as agreed upon in #94, we shouldn't make implementing IWYU functionality an explicit goal.
  2. A better approach might be to check for using namespace ... declarations and modify the regex/use a different regex for lines after such declarations, though this approach works well enough.

aaronliu0130 changed the title Avoid False Positives on Transform Issue27 Try2 Avoid IWYU False Positives on external libraries Mar 20, 2024
aaronliu0130 merged commit 3791cc4 into cpplint:develop Mar 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL