Skip to content

When clang-format fails in CI, it could print the diff #5666

@antkmsft

Description

@antkmsft

I think we can make a simple fix to make it so that if the clang-format fails, it would not only list the files where it failed, but would also print the diff.

I would not propose this, if I thought it would be expensive to fix, but I think we might be able to get away with the git diff command.

An output like this could be helpful when clang-format behaves differently on the developer machine and the CI machine, also there could be differen versions, and different behavior on different platforms. It does not happen very often, but when it happens, it can drive you crazy. When this happen, I myself run the WSL, install clang-format there, clone the repo, and do clang-format there. It takes time. Sometimes, I would be happy to just copy several strings from the build logs, and be done with it.

When we have this, and it works, I think it can be cheaply ported to the Codegen repo, and to the Embedded C repo (I am not creating similar work items in those repositories for now).

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions