Closed
Description
@jnooree The logs are out of order. The multi-threaded logs appear after the "posting comments" step (which is the last step). Since our workflow has verbosity set to debug, we can see all the logs from the captured output of clang-tidy and clang-format.
Is there a reason why sys.stdout()
would only show output after the loggers are destructed? This might be specific to GitHub Actions runners.
raw logs in question
2024-03-27T19:36:07.0326794Z ##[group]Performing checkup on docs/examples/demo/demo.cpp
2024-03-27T19:36:07.0327881Z ##[endgroup]
2024-03-27T19:36:07.0786112Z ##[group]Performing checkup on docs/examples/demo/demo.hpp
2024-03-27T19:36:07.0787112Z ##[endgroup]
2024-03-27T19:36:07.0802738Z ##[group]Posting comment(s)
2024-03-27T19:36:07.0833214Z ##[notice]File docs/examples/demo/demo.cpp does not conform to Custom style guidelines. (lines 3, 8, 10, 13, 18)
2024-03-27T19:36:07.0835454Z ##[notice]File docs/examples/demo/demo.hpp does not conform to Custom style guidelines. (lines 1, 8, 11, 12, 31, 34)
2024-03-27T19:36:07.0838900Z ##[warning]inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead
2024-03-27T19:36:07.0840487Z ##[warning]use a trailing return type for this function
2024-03-27T19:36:07.0841516Z ##[warning]statement should be inside braces
2024-03-27T19:36:07.0842473Z ##[warning]do not call c-style vararg functions
2024-03-27T19:36:07.0843491Z ##[warning]use default member initializer for 'useless'
2024-03-27T19:36:07.0844504Z ##[warning]use default member initializer for 'numb'
2024-03-27T19:36:07.0845525Z ##[warning]use a trailing return type for this function
2024-03-27T19:36:07.0846296Z INFO:CPP Linter:2 clang-format-checks-failed
2024-03-27T19:36:07.0846740Z INFO:CPP Linter:7 clang-tidy-checks-failed
2024-03-27T19:36:07.0847131Z INFO:CPP Linter:9 checks-failed
2024-03-27T19:36:07.0847818Z DEBUG:CPP Linter:comments_url: https://api.github.com/repos/cpp-linter/cpp-linter-action/issues/224/comments
2024-03-27T19:36:07.2835468Z DEBUG:CPP Linter:comment id 2023808696 from user github-actions[bot] (41898282)
2024-03-27T19:36:07.2836419Z DEBUG:CPP Linter:payload body:
2024-03-27T19:36:07.2851043Z {"body": "<!-- cpp linter action -->\n# Cpp-Linter Report :warning:\nSome files did not pass the configured checks!\n\n<details><summary>clang-format reports: <strong>2 file(s) not formatted</strong></summary>\n\n- docs/examples/demo/demo.cpp\n- docs/examples/demo/demo.hpp\n\n</details>\n<details><summary>clang-tidy reports: <strong>7 concern(s)</strong></summary>\n\n- **docs/examples/demo/demo.cpp:3:10:** warning: [[modernize-deprecated-headers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/deprecated-headers.html)]\n > inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead\n\n ```cpp\n #include <stdio.h>\n ^~~~~~~~~\n <cstdio>\n ```\n- **docs/examples/demo/demo.cpp:8:5:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\n > use a trailing return type for this function\n\n ```cpp\n int main(){\n ~~~ ^\n auto -> int\n ```\n- **docs/examples/demo/demo.cpp:10:13:** warning: [[readability-braces-around-statements](https://clang.llvm.org/extra/clang-tidy/checks/readability/braces-around-statements.html)]\n > statement should be inside braces\n\n ```cpp\n for (;;) break;\n ^\n {\n ```\n- **docs/examples/demo/demo.cpp:13:5:** warning: [[cppcoreguidelines-pro-type-vararg](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-type-vararg.html)]\n > do not call c-style vararg functions\n\n ```cpp\n printf(\"Hello world!\\n\");\n ^\n ```\n- **docs/examples/demo/demo.hpp:6:11:** warning: [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\n > use default member initializer for 'useless'\n\n ```hpp\n char* useless;\n ^\n {\"\\0\"}\n ```\n- **docs/examples/demo/demo.hpp:7:9:** warning: [[modernize-use-default-member-init](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)]\n > use default member initializer for 'numb'\n\n ```hpp\n int numb;\n ^\n {0}\n ```\n- **docs/examples/demo/demo.hpp:11:11:** warning: [[modernize-use-trailing-return-type](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-trailing-return-type.html)]\n > use a trailing return type for this function\n\n ```hpp\n void *not_useful(char *str){useless = str;}\n ~~~~~~^\n auto -> void *\n ```\n\n</details>\n\nHave any feedback or feature suggestions? [Share it here.](https://github.com/cpp-linter/cpp-linter-action/issues)"}
2024-03-27T19:36:07.6440514Z ##[endgroup]
2024-03-27T19:36:07.6454704Z INFO:CPP Linter:Running "/usr/bin/clang-tidy-12 -checks=boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-* -p /home/runner/work/cpp-linter-action/cpp-linter-action/build --extra-arg=-std=c++14 --extra-arg=-Wall docs/examples/demo/demo.cpp"
2024-03-27T19:36:07.6457417Z DEBUG:CPP Linter:Output from clang-tidy:
2024-03-27T19:36:07.6459538Z /home/runner/work/cpp-linter-action/cpp-linter-action/docs/examples/demo/demo.cpp:3:10: warning: inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead [modernize-deprecated-headers]
2024-03-27T19:36:07.6460619Z #include <stdio.h>
2024-03-27T19:36:07.6460853Z ^~~~~~~~~
2024-03-27T19:36:07.6461083Z <cstdio>
2024-03-27T19:36:07.6462083Z /home/runner/work/cpp-linter-action/cpp-linter-action/docs/examples/demo/demo.cpp:8:5: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
2024-03-27T19:36:07.6463368Z int main(){
2024-03-27T19:36:07.6463577Z ~~~ ^
2024-03-27T19:36:07.6463798Z auto -> int
2024-03-27T19:36:07.6464777Z /home/runner/work/cpp-linter-action/cpp-linter-action/docs/examples/demo/demo.cpp:10:13: warning: statement should be inside braces [readability-braces-around-statements]
2024-03-27T19:36:07.6465691Z for (;;) break;
2024-03-27T19:36:07.6465919Z ^
2024-03-27T19:36:07.6466287Z {
2024-03-27T19:36:07.6467244Z /home/runner/work/cpp-linter-action/cpp-linter-action/docs/examples/demo/demo.cpp:13:5: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
2024-03-27T19:36:07.6468214Z printf("Hello world!\n");
2024-03-27T19:36:07.6468484Z ^
2024-03-27T19:36:07.6468607Z
2024-03-27T19:36:07.6468829Z DEBUG:CPP Linter:clang-tidy made the following summary:
2024-03-27T19:36:07.6469233Z 1075 warnings generated.
2024-03-27T19:36:07.6469712Z Suppressed 1071 warnings (1067 in non-user code, 4 with check filters).
2024-03-27T19:36:07.6470673Z Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2024-03-27T19:36:07.6471299Z
2024-03-27T19:36:07.6471819Z INFO:CPP Linter:Running "/usr/bin/clang-format-12 -style=file --output-replacements-xml docs/examples/demo/demo.cpp"
2024-03-27T19:36:07.6473744Z INFO:CPP Linter:Running "/usr/bin/clang-tidy-12 -checks=boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-* -p /home/runner/work/cpp-linter-action/cpp-linter-action/build --extra-arg=-std=c++14 --extra-arg=-Wall docs/examples/demo/demo.hpp"
2024-03-27T19:36:07.6475184Z DEBUG:CPP Linter:Output from clang-tidy:
2024-03-27T19:36:07.6476266Z /home/runner/work/cpp-linter-action/cpp-linter-action/docs/examples/demo/demo.hpp:6:11: warning: use default member initializer for 'useless' [modernize-use-default-member-init]
2024-03-27T19:36:07.6477213Z char* useless;
2024-03-27T19:36:07.6477445Z ^
2024-03-27T19:36:07.6477652Z {"\0"}
2024-03-27T19:36:07.6478634Z /home/runner/work/cpp-linter-action/cpp-linter-action/docs/examples/demo/demo.hpp:7:9: warning: use default member initializer for 'numb' [modernize-use-default-member-init]
2024-03-27T19:36:07.6479546Z int numb;
2024-03-27T19:36:07.6479761Z ^
2024-03-27T19:36:07.6479965Z {0}
2024-03-27T19:36:07.6480943Z /home/runner/work/cpp-linter-action/cpp-linter-action/docs/examples/demo/demo.hpp:11:11: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
2024-03-27T19:36:07.6481930Z void *not_useful(char *str){useless = str;}
2024-03-27T19:36:07.6482263Z ~~~~~~^
2024-03-27T19:36:07.6482524Z auto -> void *
2024-03-27T19:36:07.6482743Z
2024-03-27T19:36:07.6482966Z DEBUG:CPP Linter:clang-tidy made the following summary:
2024-03-27T19:36:07.6483361Z 7 warnings generated.
2024-03-27T19:36:07.6483655Z Suppressed 4 warnings (4 with check filters).
2024-03-27T19:36:07.6483916Z
2024-03-27T19:36:07.6484428Z INFO:CPP Linter:Running "/usr/bin/clang-format-12 -style=file --output-replacements-xml docs/examples/demo/demo.hpp"
Originally posted by @2bndy5 in cpp-linter/cpp-linter-action#224 (comment)
Metadata
Metadata
Assignees
Labels
No labels