feluelle commented on a change in pull request #5786: [AIRFLOW-5170]
[AIRFLOW-5256] Consistent licences for python files and related pylint fixes
URL: https://github.com/apache/airflow/pull/5786#discussion_r323775945
##########
File path: scripts/ci/in_container/_in_container_utils.sh
##########
@@ -121,4 +121,59 @@ function in_container_basic_sanity_check() {
in_container_cleanup_pycache
}
+function in_container_refresh_pylint_todo() {
+ print_in_container_info
+ print_in_container_info "Refreshing list of all non-pylint compliant
files. This can take some time."
+ print_in_container_info
+
+ print_in_container_info
+ print_in_container_info "Finding list all non-pylint compliant files
everywhere except 'tests' folder"
+ print_in_container_info
+
+ # Using path -prune is much better in the local environment on OSX because
we have host
+ # Files mounted and node_modules is a huge directory which takes many
seconds to even scan
+ # -prune works better than -not path because it skips traversing the whole
directory. -not path traverses
+ # the directory and only excludes it after all of it is scanned
+ find . \
+ -path "./airflow/www/node_modules" -prune -o \
+ -path "./airflow/www_rbac/node_modules" -prune -o \
+ -path "./airflow/_vendor" -prune -o \
+ -path "./airflow/migrations/versions" -prune -o \
+ -path "./.eggs" -prune -o \
+ -path "./docs/_build" -prune -o \
+ -path "./build" -prune -o \
+ -path "./tests" -prune -o \
+ -name "*.py" \
+ -not -name 'webserver_config.py' | \
+ grep ".*.py$" | \
+ xargs pylint | tee "${MY_DIR}/../pylint_todo_main.txt"
+
+ grep -v "\*\*" < "${MY_DIR}/../pylint_todo_main.txt" | \
+ grep -v "^$" | grep -v "\-\-\-" | grep -v "^Your code has been" | \
+ awk 'FS=":" {print "./"$1}' | sort | uniq >
"${MY_DIR}/../pylint_todo_new.txt"
+
+ print_in_container_info
+ print_in_container_info "So far found $(wc -l
<"${MY_DIR}/../pylint_todo_new.txt") files"
+ print_in_container_info
+
+ print_in_container_info
+ print_in_container_info "Finding list of all non-pylint compliant files in
'tests' folder"
+ print_in_container_info
+
+ find "./tests" -name "*.py" -print0 | \
+ xargs -0 pylint --disable="${DISABLE_CHECKS_FOR_TESTS}" | tee
"${MY_DIR}/../pylint_todo_tests.txt"
+
+ grep -v "\*\*" < "${MY_DIR}/../pylint_todo_tests.txt" | \
+ grep -v "^$" | grep -v "\-\-\-" | grep -v "^Your code has been" | \
+ awk 'FS=":" {print "./"$1}' | sort | uniq >>
"${MY_DIR}/../pylint_todo_new.txt"
+
+ rm -fv "${MY_DIR}/../pylint_todo_main.txt"
"${MY_DIR}/../pylint_todo_tests.txt"
+ mv -v "${MY_DIR}/../pylint_todo_new.txt" "${MY_DIR}/../pylint_todo.txt"
+
+
Review comment:
```suggestion
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services