Skip to content

Commit

Permalink
Show stderr output of include-what-you-use tool
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq committed Nov 25, 2022
1 parent 5cb14fd commit 5c5f2a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/helpers/iwyu-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,17 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir,
shell=True,
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stderr=subprocess.STDOUT)

logging.info("============== IWYU output start ================")

logger = logging.info
while status.poll() is None:
line = status.stdout.readline().rstrip()

if re.match(r"^.*([A-Za-z0-9]+(/[A-Za-z0-9]+)+)\.cpp should [a-zA-Z]+ these lines:$", line):
if re.match(r"^warning:.*$", line):
logger = logging.warning
elif re.match(r"^.*([A-Za-z0-9]+(/[A-Za-z0-9]+)+)\.cpp should [a-zA-Z]+ these lines:$", line):
logger = logging.warning
elif re.match(r"^.*([A-Za-z0-9]+(/[A-Za-z0-9]+)+)\.[a-zA-Z]+ has correct #includes/fwd-decls\)$", line):
logger = logging.info
Expand Down

0 comments on commit 5c5f2a8

Please sign in to comment.