You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/02/17 19:20:29 UTC
[GitHub] [tvm] driazati commented on a change in pull request #10284: Add -i option to fix ASF headers to lint scripts.
driazati commented on a change in pull request #10284:
URL: https://github.com/apache/tvm/pull/10284#discussion_r809387431
##########
File path: docker/lint.sh
##########
@@ -37,6 +37,9 @@ function run_lint_step() {
;;
asf)
cmd=( tests/lint/check_asf_header.sh --local )
+ if [ $inplace_fix -eq 1 ]; then
Review comment:
Can you edit the default case to explain what the `-i` flag does
##########
File path: tests/lint/check_asf_header.sh
##########
@@ -44,14 +57,25 @@ if [ ${filter_untracked} -eq 1 ]; then
rat_output="${processed_rat_output}"
fi
-if grep --quiet -E "File" "${rat_output}"; then
- echo "Need to add ASF header to the following files."
+grep --quiet -E "File" "${rat_output}" && success=1 || success=0
+
+if [ $success -eq 0 ]; then
+ echo "No files violate ASF header check"
+else
+ if [ $fix -eq 1 ]; then
+ python3 tests/lint/add_asf_header.py "${rat_output}"
+ echo "Ran add_asf_header.py to fix the following files:"
+ else
+ echo "Need to add ASF header to the following files."
+ fi
echo "----------------File List----------------"
cat "${rat_output}"
echo "-----------------------------------------"
- echo "Use the following steps to add the headers:"
- echo "- Create file_list.txt in your text editor"
- echo "- Copy paste the above content in file-list into file_list.txt"
- echo "- python3 tests/lint/add_asf_header.py file_list.txt"
+ if [ $fix -eq 0 ]; then
+ echo "To fix, run check_asf_header.sh --fix, or use the following manual steps:"
Review comment:
this is a little confusing imo when run from `docker/lint.sh` since you don't actually need to run `check_asf_header.sh` manually, maybe add a note about what to do if run from `lint.sh`?
--
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@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org