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

Improve warning message for missing includes #113

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

Pennycook
Copy link
Contributor

@Pennycook Pennycook commented Sep 19, 2024

Related issues

Closes #50.

I adopted a slightly different solution than that outlined in #50, after offline discussion with @laserkelvin. Rather than print a large number of suggested actions as part of each individual warning message, we can use a meta-warning to describe suggested fixes just once.

Proposed changes

  • Clarify that the warning pertains to a missing include.
  • Differentiate between user and system includes.
  • Show the line of code that triggered the warning.

A quick example of what this looks like:

[WARNING ] /path/to/source/file.cpp:77: user include 'float.h' not found
   77 | #include "float.h"
[WARNING ] /path/to/source/file.cpp:79: system include 'cstring' not found
   79 | #include <cstring>

Writing "user" or "system" in the message is mainly there to help us build a WarningAggregator that can give different advice in both cases, but it should also be helpful for anybody greping through the logs.

- Clarify that the warning pertains to a missing include.
- Differentiate between user and system includes.
- Show the line of code that triggered the warning.

Signed-off-by: John Pennycook <john.pennycook@intel.com>
@Pennycook Pennycook added the enhancement New feature or request label Sep 19, 2024
@Pennycook Pennycook added this to the 2.0.0 milestone Sep 19, 2024
@Pennycook Pennycook merged commit c400221 into intel:main Sep 25, 2024
3 checks passed
@Pennycook Pennycook deleted the include-warning branch September 25, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning for include files is unclear
2 participants