7 Commits

Author SHA1 Message Date
Louis Dionne
3e28e1ec56
[code-format] Also include libc++ extensionless headers and .inc and .cppm (#73142)
These headers were skipped by the job because they didn't have an
extension. However, such headers are extremely common in libc++.

As a drive-by change, also include `.cppm` and `.inc` extensions since
those are also common in libc++.
2023-11-22 13:03:05 -05:00
Aiden Grossman
56d0e8ccf4
[Github] Print diff in code format helper (#72742)
Currently, when the code format action fails, it leaves no log of the
diff in the output within the action itself. This has caused confusion
for some users of the action, especially when the comment becomes buried
in a 100+ comment review and someone isn't super familiar with the inner
workings of the CI. This patch prints the diff produced by the code
formatter to stdout so that it is viewable by clicking on the failed
action. This should have very little cost and make things slightly less
confusing for those that run into this situation.
2023-11-18 01:06:40 -08:00
Ryan Prichard
56cadac85b
[Workflow] Expand code-format-helper.py error reporting (#69686)
* Consider the darker/clang-format command to have failed if the exit
   code is non-zero, regardless of the stdout/stderr output.
* Propagate stderr from the formatter command to the script's
   caller (and into the GitHub log).
* On success, dump stdout to the caller, so it ends up in GitHub's log.
   I'm not sure what this would ever be, but if it exists, it should be
   preserved.
* Just before the script exits, if any formatter failed, print a line
   showing which formatters failed.
2023-10-26 19:13:20 -07:00
Ryan Prichard
af25304319
[Workflow] make code-format-helper.py mypy-safe (NFC) (#69691)
Fix type errors that mypy reports with code-format-helper.py.

Add a few return type annotations and change `param: [str]` to
`param: list[str]`.

Leave a few required FormatHelper members missing instead of defining a
placeholder:
 - FormatHelper.name
 - FormatHelper.friendly_name
 - FormatHelper.format_run: NotImplementedError() instead of `pass`
2023-10-20 15:07:59 -07:00
Tobias Hieta
a1177b0bdb
Reland: [Workflow] Add new code format helper.
I landed this format helper, but unfortunately, it didn't work because
of permissions, it could not add comments on a fork's PR. @cor3ntin
informed me there are fixes for this that you had worked on @tstellar -
but I didn't have time to read up on it too much. Can you explain what
changes are needed to get the action to be able to write comments on
fork's PR?
2023-09-22 10:26:09 +02:00
Tobias Hieta
fe5c185641
Revert "[Workflow] Add new code format helper. (#66684)"
This reverts commit da94bf0d561109529e4ab3dabfcbb8b6c258ea39.
2023-09-20 10:01:37 +02:00
Tobias Hieta
da94bf0d56
[Workflow] Add new code format helper. (#66684)
This helper will format python files with black/darker and
C/C++ files with clang-format.

The format helper is written so that we can expand it with new
formatters in the future like clang-tidy.
2023-09-20 08:52:29 +02:00