You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/02/07 13:35:05 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 opened a new pull request #56: Ensure all source code end with one and only one newline

xiaoxiang781216 opened a new pull request #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56
 
 
   by this command:
   git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
   
   Signed-off-by: Xiang Xiao <xi...@xiaomi.com>

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] davids5 commented on issue #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
davids5 commented on issue #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#issuecomment-583396552
 
 
   @xiaoxiang781216 is this safe on all types of files?

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#issuecomment-583450422
 
 
   > @xiaoxiang781216 is this safe on all types of files?
   
   @davids5 I remove all binary file from the commit manually after running the command. If some text file isn't suitable to have the new line at the end of file, I can remove it from the commit.

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] davids5 commented on issue #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
davids5 commented on issue #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#issuecomment-583455737
 
 
   Have you considered just enabling the pre commit hook that comes with git that checks for the sort of thing?

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#discussion_r376404535
 
 

 ##########
 File path: examples/elf/tests/helloxx/.gitignore
 ##########
 @@ -2,4 +2,4 @@ hello++1
 hello++2
 hello++3
 hello++4
-hello++5
\ No newline at end of file
+hello++5
 
 Review comment:
   It is really impossible to see.  Is there a newline after hello++5 or not?  Where there two before and now only one?  Or is there no newline now.  That would be bad.

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#issuecomment-583453267
 
 
   @patacongo should we reconsider this patch again? the consistence is most important thing for coding sandard:
   1.Ensure all source code end with one and only one newline
   2.Enusre all source code don't end with any newline
   Mixing both is the most bad thing.

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo closed pull request #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
patacongo closed pull request #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56
 
 
   

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#issuecomment-583460007
 
 
   > Have you considered just enabling the pre commit hook that comes with git that checks for the sort of thing?
   
   Yes, we should improve the tool. Before that we have do this manually, but it's better than we do nothing. The only important thing for coding standard is consistent.

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#issuecomment-583449362
 
 
   > "is this safe on all types of files?" It is inappropriate on the .txt file that needs the newline for visual spacing.
   > 
   
   Ok, I will remove the test file from PR.
   
   > Other source files will depend on if there is 0 or 1 newlines at the end. Looking at the diffs, I cannot tell if there is 0 or 1 newlines at the end now.
   > 
   
   The command can ensure this:
   git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
   Here has the detailed explanation for each step:
   https://unix.stackexchange.com/questions/31947/how-to-add-a-newline-to-the-end-of-a-file
   Actually, it's good thing to ensure one and only one newline at the end of file for consistency and avoid git complain "No newline at end of file":
   ![image](https://user-images.githubusercontent.com/18066964/74041360-77e25b00-4a00-11ea-803d-033bd719d8bb.png)
   
   
   > I would think that most apps should work with a single newline. Many applications are even tolerant of missing newlines at the end altogether. kconfig-frontends is not. Kconfig files with no newline at the end causes errors.
   

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#discussion_r376403770
 
 

 ##########
 File path: examples/cromfs/cromfs/testdir2/TheThreeLittlePigs.txt
 ##########
 @@ -14,4 +14,4 @@ The little pig saw the wolf climb up on the roof and lit a roaring fire in the f
 
 
 Review comment:
   This is just a test file, but in this case, the trailing newline is for visual spacing since the story of the 3 little pigs is displayed.  It really needs the trailing newline since all of the text is double spaced and without the final newline, the text will run together on the display.

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#issuecomment-583739210
 
 
   @patacongo since the samiliar patch is alrady merged in nuttx repo:
   https://github.com/apache/incubator-nuttx/pull/226
   Could you reopen this PR, so I can remove TheThreeLittlePigs.txt from patch?

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#discussion_r376444329
 
 

 ##########
 File path: examples/elf/tests/helloxx/.gitignore
 ##########
 @@ -2,4 +2,4 @@ hello++1
 hello++2
 hello++3
 hello++4
-hello++5
\ No newline at end of file
+hello++5
 
 Review comment:
   No, you can see there is a red dot at the end of line before change which mean no newline there:
   ![image](https://user-images.githubusercontent.com/18066964/74040901-998f1280-49ff-11ea-939a-929b2f7c99a0.png)
   

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on issue #56: Ensure all source code end with one and only one newline

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #56: Ensure all source code end with one and only one newline
URL: https://github.com/apache/incubator-nuttx-apps/pull/56#issuecomment-583403450
 
 
   "is this safe on all types of files?"  It is inappropriate on the .txt file that needs the newline for visual spacing.
   
   Other source files will depend on if there is 0 or 1 newlines at the end.  Looking at the diffs, I cannot tell if there is 0 or 1 newlines at the end now.
   
   I would think that most apps should work with a single newline.  Many applications are even tolerant of missing newlines at the end altogether.  kconfig-frontends is not.  Kconfig files with no newline at the end causes errors.

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


With regards,
Apache Git Services