patacongo commented on a change in pull request #2: Master pr nxstyle 
improvments
URL: https://github.com/apache/incubator-nuttx/pull/2#discussion_r360727425
 
 

 ##########
 File path: tools/check_code_style.sh
 ##########
 @@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+if [ -z "$1" ]; then
+       FILES=$(git diff master --name-only);
+else
+       FILES=$1
+fi
+
+DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+for FILE in $FILES; do
+  FILENAME=$(basename $FILE)
+  FILE_EXT="${FILENAME#*.}"
+  if [ -f "$FILE" ]; then
+    if [ "$FILE_EXT" = "c" ] || [ "$FILE_EXT" = "h" ]; then
+         CHECK_FAILED=$(${DIR}/nxstyle $FILE)
+       #       if [ -n "$CHECK_FAILED" ]; then
+       #               ${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
+       #
+       #               echo
+       #               git --no-pager diff --no-index --minimal --histogram 
--color=always $FILE $FILE.pretty
+       #               rm -f $FILE.pretty
 
 Review comment:
   Again, check for the existence of .git/ before using any git commands.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to