-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code. #20433
[Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code. #20433
Conversation
Hey @mozga-intel , Thanks for submitting the PR
CI supported jobs: [windows-cpu, windows-gpu, miscellaneous, centos-cpu, sanity, unix-cpu, edge, centos-gpu, unix-gpu, website, clang] Note: |
Would you like to add a CI step (Jenkins or Github Actions) to enforce the style is met? |
@leezu @szha How about preparing a separate and specific-designed CI' job - we can call it lint_clang for instance? It could be a CI' job with a single responsibility, responsible only for checking and keeping a code well-formatted. Inside, all checkers can be run: a clang-format and clang-tidy script for c++, a falke8 checker for python and so on. It could be a fundamental basic property. A bash script with a single configuration - run this, this and this (either one script to run all checkers, or a few scripts to run one-dedicated) However, a common theme running through this idea is a fundamental relationship that those things need to be placed in the same job. I have one open questions to discuss:
|
@mozga-intel we have lint in sanity check and I think this can be put in sanity check too. Sanity check is required to pass before other pipelines kick in. |
da61dd4
to
6889cb8
Compare
@szha @leezu How about adding a workflow like this: please have a look at: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| clang-format failures found! Run:
| tool/lint/clang_format_ci.sh 3480ba2c6df02bb907d3a975d354efa8697c4e71
| to fix this error.
| **For more info, see: ___LINK__TO_WIKI__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If something goes wrong, then you get an error: please have a look at the example: Link. |
@mxnet-bot run ci [sanity] |
1 similar comment
@mxnet-bot run ci [sanity] |
Jenkins CI successfully triggered : [sanity] |
|
Note that there's also a license header missing in the new file. |
@mxnet-bot run ci [centos-gpu] |
Jenkins CI successfully triggered : [centos-gpu] |
@mxnet-bot run ci [centos-gpu] |
Jenkins CI successfully triggered : [centos-gpu] |
@mxnet-bot run ci [centos-gpu] |
Jenkins CI successfully triggered : [centos-gpu] |
LGTM |
@mxnet-bot run ci [sanity] |
Jenkins CI successfully triggered : [sanity] |
Description
There is used clang-format tool to perform additional formatting and semantic checking of code. This pull request contains a pre-commit git hook, a git-pre-commit file, (Related to: #20406, #20356 #20429)
Since clang-format needs to be installed with an appropriate configuration, the file with the requirements has to be run:
After that, we need to set up a symbolic link to a given file: To create a symbolic link to a given file, open your terminal and type:
If you have not set up the pre-commit hooks, you can run it locally in your local branch.
Checklist
Essentials
Changes
Comments