You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/07/09 16:00:22 UTC

[GitHub] [incubator-mxnet] mozga-intel opened a new pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

mozga-intel opened a new pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433


   ## 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:
   ```
   ln -s ../../tools/git-pre-commit .git/hooks/pre-commit
   ```
   
   If you have not set up the pre-commit hooks, you can run it locally in your local branch.
   
   ## Checklist ##
   ### Essentials ###
   - [ ] PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage
   - [ ] Code is well-documented
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be made.
   - Interesting edge cases to note here
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-918269250


   Jenkins CI successfully triggered : [unix-cpu, unix-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-887760040


   @mxnet-bot run ci [miscellaneous]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-918269147


   @mxnet-bot run ci [unix-cpu, unix-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-877411335


   Would you like to add a CI step (Jenkins or Github Actions) to enforce the style is met?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-890789723


   Jenkins CI successfully triggered : [centos-gpu, centos-cpu, unix-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel edited a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-881463020


   @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: 
   - How the differences should be shown? - Either report it directly by showing that something went wrong or maybe it could be better to do it automatically behind a curtain. [Personally, I prefer to report any mistakes]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-887804740


   > Note that there's also a license header missing in the new file.
   
   @szha Thanks! I reckon, this file should be completely excluded during an analysis - I excluded this checking by adding entry to the rat-exception file. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-896125382


   @mxnet-bot run ci [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-895500585


   @mxnet-bot run ci [centos-gpu, unix-cpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-889375088


   @szha Good point! The entry was added. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-885646508


    @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-921638858


   Jenkins CI successfully triggered : [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-877289026


   Hey @mozga-intel , Thanks for submitting the PR 
   All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands: 
   - To trigger all jobs: @mxnet-bot run ci [all] 
   - To trigger specific jobs: @mxnet-bot run ci [job1, job2] 
   *** 
   **CI supported jobs**: [windows-cpu, windows-gpu, miscellaneous, centos-cpu, sanity, unix-cpu, edge, centos-gpu, unix-gpu, website, clang]
   *** 
   _Note_: 
    Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin. 
   All CI tests must pass before the PR can be merged. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel removed a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel removed a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-885646508


    @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-937938865


   @szha @leezu @akarbown Could you please review it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha merged pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha merged pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on a change in pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on a change in pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#discussion_r710374512



##########
File path: ci/docker/runtime_functions.sh
##########
@@ -716,6 +717,43 @@ sanity_cpp() {
     3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin cpp-package tests --exclude_path src/operator/contrib/ctc_include include/onednn
 }
 
+sanity_clang() {
+    set -ex
+    # .github/workgflows/greetings.yml passes BASE_SHA, GITHUB_RUN_ID, GITHUB_BASE_REF for pull requests.
+    BASE_SHA="${GITHUB_PR_BASE_SHA}"
+    GITHUB_RUN_ID="${GITHUB_PR_RUN_ID}"
+    GITHUB_BASE_REF="${GITHUB_PR_BASE_REF}"
+
+    if [ "${BASE_SHA}" == "" ]; then
+        BASE_SHA=`git show-ref --hash refs/remotes/origin/master`
+        if [ "${GITHUB_RUN_ID}" == "" ] || [ "${GITHUB_BASE_REF}" == "" ]; then
+             GITHUB_RUN_ID=`(git log --pretty=format:'%h' -n 1)`
+             GITHUB_BASE_REF="master"
+        fi
+    fi
+
+    git remote add "${GITHUB_RUN_ID}" https://github.com/apache/incubator-mxnet.git
+    git fetch "${GITHUB_RUN_ID}" "$GITHUB_BASE_REF"
+    
+    tools/lint/clang_format_ci.sh "${BASE_SHA}"
+    GIT_DIFFERENCE=$(git diff)
+    if [[ -z $GIT_DIFFERENCE ]]; then
+        git remote remove "${GITHUB_RUN_ID}" # temporary remote is removed
+        exit 0
+    fi
+    
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    echo "| clang-format failures found! Run: "
+    echo "|    tool/lint/clang_format_ci.sh ${BASE_SHA} "
+    echo "| to fix this error. "
+    echo "| For more info, see: "
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    
+    echo "$GIT_DIFFERENCE"
+    git remote remove "${GITHUB_RUN_ID}" # temporary remote is removed
+    exit 1

Review comment:
       Good question! Basically, there are two scenarios: If you exit on 742 line, then remote branch will be removed on 741. If you exit on 753, then remote branch will be removed on 753.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-889170631


   Jenkins CI successfully triggered : [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886505000


   @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel removed a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel removed a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886505000


   @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-888351867


   @mozga-intel in that case could you add an entry in the LICENSE file too?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886258629


   @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-884199469


   @szha @leezu How about adding a workflow like this: please have a look at: `Clang format lint / clang-format (pull_request)`. in this PR.  The clang-format checks the latest master with the current branch. If something goes wrong, then you get an error message.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on a change in pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on a change in pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#discussion_r710374512



##########
File path: ci/docker/runtime_functions.sh
##########
@@ -716,6 +717,43 @@ sanity_cpp() {
     3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin cpp-package tests --exclude_path src/operator/contrib/ctc_include include/onednn
 }
 
+sanity_clang() {
+    set -ex
+    # .github/workgflows/greetings.yml passes BASE_SHA, GITHUB_RUN_ID, GITHUB_BASE_REF for pull requests.
+    BASE_SHA="${GITHUB_PR_BASE_SHA}"
+    GITHUB_RUN_ID="${GITHUB_PR_RUN_ID}"
+    GITHUB_BASE_REF="${GITHUB_PR_BASE_REF}"
+
+    if [ "${BASE_SHA}" == "" ]; then
+        BASE_SHA=`git show-ref --hash refs/remotes/origin/master`
+        if [ "${GITHUB_RUN_ID}" == "" ] || [ "${GITHUB_BASE_REF}" == "" ]; then
+             GITHUB_RUN_ID=`(git log --pretty=format:'%h' -n 1)`
+             GITHUB_BASE_REF="master"
+        fi
+    fi
+
+    git remote add "${GITHUB_RUN_ID}" https://github.com/apache/incubator-mxnet.git
+    git fetch "${GITHUB_RUN_ID}" "$GITHUB_BASE_REF"
+    
+    tools/lint/clang_format_ci.sh "${BASE_SHA}"
+    GIT_DIFFERENCE=$(git diff)
+    if [[ -z $GIT_DIFFERENCE ]]; then
+        git remote remove "${GITHUB_RUN_ID}" # temporary remote is removed
+        exit 0
+    fi
+    
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    echo "| clang-format failures found! Run: "
+    echo "|    tool/lint/clang_format_ci.sh ${BASE_SHA} "
+    echo "| to fix this error. "
+    echo "| For more info, see: "
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    
+    echo "$GIT_DIFFERENCE"
+    git remote remove "${GITHUB_RUN_ID}" # temporary remote is removed
+    exit 1

Review comment:
       Good question! Basically, there are two scenarios: If you exit on 742 line, then remote branch will be removed on 741. If you exit on 754, then remote branch will be removed on 753.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-922055737


   @mxnet-bot run ci [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-896128909


   Jenkins CI successfully triggered : [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-937956068


   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-887760119


   Jenkins CI successfully triggered : [miscellaneous]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel edited a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-887804740


   > Note that there's also a license header missing in the new file.
   
   @szha Thanks! I reckon this file should be completely excluded during an analysis - I skip this checking by adding an entry to the rat-exception file. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel edited a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-881463020


   @leezu 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 environment.
   
   I have one open questions to discuss: 
   - How the differences should be shown? - Either report it directly by showing that something went wrong or maybe it could be better to do it automatically behind a curtain. [Personally, I prefer to report any mistakes]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-889170524


   @mxnet-bot run ci [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on a change in pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on a change in pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#discussion_r709197424



##########
File path: ci/docker/runtime_functions.sh
##########
@@ -716,6 +717,42 @@ sanity_cpp() {
     3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin cpp-package tests --exclude_path src/operator/contrib/ctc_include include/onednn
 }
 
+sanity_clang() {
+    set -ex
+    # .github/workgflows/greetings.yml passes BASE_SHA, GITHUB_RUN_ID, GITHUB_BASE_REF for pull requests.
+    BASE_SHA="${GITHUB_PR_BASE_SHA}"
+    GITHUB_RUN_ID="${GITHUB_PR_RUN_ID}"
+    GITHUB_BASE_REF="${GITHUB_PR_BASE_REF}"
+
+    if [ "${BASE_SHA}" == "" ]; then
+        BASE_SHA=`git show-ref --hash refs/remotes/origin/master`
+        if [ "${GITHUB_RUN_ID}" == "" ] || [ "${GITHUB_BASE_REF}" == "" ]; then
+             GITHUB_RUN_ID=`(git log --pretty=format:'%h' -n 1)`
+             GITHUB_BASE_REF="master"
+        fi
+    fi
+
+    git remote add "${GITHUB_RUN_ID}" https://github.com/apache/incubator-mxnet.git
+    git fetch "${GITHUB_RUN_ID}" "$GITHUB_BASE_REF"
+
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    echo "| clang-format failures found! Run: "

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-921638775


   @mxnet-bot run ci [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886903776


   `/work/runtime_functions.sh: line 722: ${{ github.event.pull_request.base.sha }}: bad substitution`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel edited a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-884199469


   @szha @leezu How about adding a workflow like this: please have a look at: `Clang format lint / clang-format (pull_request)`. in this PR.  The clang-format checks the latest master with the current branch. If something goes wrong, then you get an error message. If clang-format finds an error, then we can add a special description on a wiki of how to run clang_format locally. 
   ```bash
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   | clang-format failures found! Run: 
   |    tool/lint/clang_format_ci.sh 3480ba2c6df02bb907d3a975d354efa8697c4e71 
   | to fix this error. 
   | **For more info, see: ___LINK__TO_WIKI__
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
   ```
   * LINK_TO_WIKI there is a place to put a link. 
   
   > * How the differences should be shown? - Either report it directly by showing that something went wrong or maybe it could be better to do it automatically behind a curtain. [Personally, I prefer to report any mistakes]
   
   If something goes wrong, then you get an error: please have a look at the example: [Link](https://github.com/apache/incubator-mxnet/runs/3124138013?check_suite_focus=true).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-939028908


   Jenkins CI successfully triggered : [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886797861


   @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel edited a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-881463020


   @leezu How about preparing a separate and specific-designed CI' job - we can call it lint_clang for clarity? 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 environment.
   
   I have one open questions to discuss: 
   - How the differences should be shown? - Either report it directly by showing that something went wrong or maybe it could be better to do it automatically behind a curtain. [Personally, I prefer to report any mistakes]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-890971308


   Jenkins CI successfully triggered : [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-881463020


   @leezu How about preparing a separate and specific-designed CI' job - we can call it lint_clang for clarity? 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 environment.
   
   I have one open questions to discuss: 
   - First of all: How the differences should be shown? - Either report it directly by showing that something went wrong or maybe it could be better to do it automatically behind a curtain. [Personally, I prefer report]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-918381042


   Jenkins CI successfully triggered : [centos-gpu, unix-cpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-918380966


   @mxnet-bot run ci [centos-gpu, unix-cpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-890789658


   @mxnet-bot run ci [centos-gpu, centos-cpu, unix-gpu ]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-895500644


   Jenkins CI successfully triggered : [centos-gpu, unix-cpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-890971228


   @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886900127


   @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-939028675


   @mxnet-bot run ci [sanity]
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-890899390


   Jenkins CI successfully triggered : [centos-gpu, unix-gpu, centos-cpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel edited a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-884199469


   @szha @leezu How about adding a workflow like this: please have a look at: `Clang format lint / clang-format (pull_request)` in this PR.  The clang-format checks the latest master with the current branch. If something goes wrong, then you get an error message. If clang-format finds an error, then we can add a special description on a wiki of how to run clang_format locally. 
   ```bash
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   | clang-format failures found! Run: 
   |    tool/lint/clang_format_ci.sh 3480ba2c6df02bb907d3a975d354efa8697c4e71 
   | to fix this error. 
   | **For more info, see: ___LINK__TO_WIKI__
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
   ```
   * LINK_TO_WIKI there is a place to put a link. 
   
   > * How the differences should be shown? - Either report it directly by showing that something went wrong or maybe it could be better to do it automatically behind a curtain. [Personally, I prefer to report any mistakes]
   
   If something goes wrong, then you get an error: please have a look at the example: [Link](https://github.com/apache/incubator-mxnet/runs/3124138013?check_suite_focus=true).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886900183


   Jenkins CI successfully triggered : [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel edited a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel edited a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-881463020


   @leezu 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: 
   - How the differences should be shown? - Either report it directly by showing that something went wrong or maybe it could be better to do it automatically behind a curtain. [Personally, I prefer to report any mistakes]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-937956068


   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886951538


   Note that there's also a license header missing in the new file.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-881521181


   @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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-922055772


   Jenkins CI successfully triggered : [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on a change in pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
szha commented on a change in pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#discussion_r709644361



##########
File path: ci/docker/runtime_functions.sh
##########
@@ -716,6 +717,43 @@ sanity_cpp() {
     3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin cpp-package tests --exclude_path src/operator/contrib/ctc_include include/onednn
 }
 
+sanity_clang() {
+    set -ex
+    # .github/workgflows/greetings.yml passes BASE_SHA, GITHUB_RUN_ID, GITHUB_BASE_REF for pull requests.
+    BASE_SHA="${GITHUB_PR_BASE_SHA}"
+    GITHUB_RUN_ID="${GITHUB_PR_RUN_ID}"
+    GITHUB_BASE_REF="${GITHUB_PR_BASE_REF}"
+
+    if [ "${BASE_SHA}" == "" ]; then
+        BASE_SHA=`git show-ref --hash refs/remotes/origin/master`
+        if [ "${GITHUB_RUN_ID}" == "" ] || [ "${GITHUB_BASE_REF}" == "" ]; then
+             GITHUB_RUN_ID=`(git log --pretty=format:'%h' -n 1)`
+             GITHUB_BASE_REF="master"
+        fi
+    fi
+
+    git remote add "${GITHUB_RUN_ID}" https://github.com/apache/incubator-mxnet.git
+    git fetch "${GITHUB_RUN_ID}" "$GITHUB_BASE_REF"
+    
+    tools/lint/clang_format_ci.sh "${BASE_SHA}"
+    GIT_DIFFERENCE=$(git diff)
+    if [[ -z $GIT_DIFFERENCE ]]; then
+        git remote remove "${GITHUB_RUN_ID}" # temporary remote is removed
+        exit 0
+    fi
+    
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    echo "| clang-format failures found! Run: "
+    echo "|    tool/lint/clang_format_ci.sh ${BASE_SHA} "
+    echo "| to fix this error. "
+    echo "| For more info, see: "
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    
+    echo "$GIT_DIFFERENCE"
+    git remote remove "${GITHUB_RUN_ID}" # temporary remote is removed
+    exit 1

Review comment:
       If you exit on 742, who takes care of removing the added remote on 753?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel removed a comment on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel removed a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-886797861


   @mxnet-bot run ci [sanity]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel removed a comment on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel removed a comment on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-896124798


   @mxnet-bot run ci [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-890899300


   @mxnet-bot run ci [centos-gpu, centos-cpu, unix-gpu ]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] anko-intel commented on a change in pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
anko-intel commented on a change in pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#discussion_r707994914



##########
File path: ci/docker/runtime_functions.sh
##########
@@ -716,6 +717,42 @@ sanity_cpp() {
     3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin cpp-package tests --exclude_path src/operator/contrib/ctc_include include/onednn
 }
 
+sanity_clang() {
+    set -ex
+    # .github/workgflows/greetings.yml passes BASE_SHA, GITHUB_RUN_ID, GITHUB_BASE_REF for pull requests.
+    BASE_SHA="${GITHUB_PR_BASE_SHA}"
+    GITHUB_RUN_ID="${GITHUB_PR_RUN_ID}"
+    GITHUB_BASE_REF="${GITHUB_PR_BASE_REF}"
+
+    if [ "${BASE_SHA}" == "" ]; then
+        BASE_SHA=`git show-ref --hash refs/remotes/origin/master`
+        if [ "${GITHUB_RUN_ID}" == "" ] || [ "${GITHUB_BASE_REF}" == "" ]; then
+             GITHUB_RUN_ID=`(git log --pretty=format:'%h' -n 1)`
+             GITHUB_BASE_REF="master"
+        fi
+    fi
+
+    git remote add "${GITHUB_RUN_ID}" https://github.com/apache/incubator-mxnet.git
+    git fetch "${GITHUB_RUN_ID}" "$GITHUB_BASE_REF"
+
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    echo "| clang-format failures found! Run: "

Review comment:
       I looks like it will be always shown, even without failure




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-921685516


   @mxnet-bot run ci [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-921685570


   Jenkins CI successfully triggered : [centos-gpu]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mozga-intel commented on pull request #20433: [Feature][Master] Clang-format tool to perform additional formatting and semantic checking of code.

Posted by GitBox <gi...@apache.org>.
mozga-intel commented on pull request #20433:
URL: https://github.com/apache/incubator-mxnet/pull/20433#issuecomment-937938865


   @szha @leezu @akarbown Could you please review it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org