arvindshmicrosoft commented on a change in pull request #340: Cleanup Python 
and Ansible Code
URL: https://github.com/apache/fluo-muchos/pull/340#discussion_r409967237
 
 

 ##########
 File path: scripts/cibuild.sh
 ##########
 @@ -0,0 +1,12 @@
+set -e
+echo "Running nose tests"
+nosetests -w lib/
+echo "Running Ansible-lint"
+ansible-lint -x 204,301
+echo "Ansible-lint returned OK"
+echo "Running flake8 to check Python code"
+flake8
+echo "flake8 returned OK"
+echo "Checking for files which have no newline at end of file"
+git ls-files | tr '\n' '\0' | xargs -0 -L1 bash -c 'if test "$(grep 
--files-with-matches --binary-files=without-match --max-count=1 --regexp='.*' 
"$0")" && test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; 
false; fi'
 
 Review comment:
   Thanks Christopher. I pulled the EOF newline check into a separate script, 
cleaned things up a bit and ensured shellcheck passes (a cool thing it flagged 
in the process was SC2143 which I have addressed by using grep -q). Thanks 
again for pushing on these, I am learning a bunch about scripting good 
practices in the process.

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

Reply via email to