Mentorship-android: Locate all files with "no newline at end of file" issue and fix those

Created on 12 Feb 2019  路  11Comments  路  Source: anitab-org/mentorship-android

Description

As a developer,
I need to put the newline as a last character in files (if it is allowed by the file format),
so that I can maintain a good style of the codebase and I will not be shown "No newline at end of file" warnings when doing a git diff.

Why is it considered a good style to add newline at the end of file:

  • it is something that historically comes from the C language standard
  • many Unix tools require or expect it for proper display
  • each line in a text file terminates with an "end-of-line" character, the last line is not an exception

Acceptance Criteria

Update [Required]

  • [ ] Locate all files that do not contain new line as the last line (if the format permits).
  • [ ] Add a new line in problematic files and see "No newline at end of file" warning disappear when git diff.

Definition of Done

  • [ ] All of the required items are completed.
  • [x] Approval by 1 mentor.

Estimation

0.5 hours

Coding First Timers Only Available Maintenance

Most helpful comment

Hello @KING-SID , so you should check all files and then place the cursor in the end. Imagine a text file - if you walk down with cursor and can reach a separate line with no text means the file is correct. If the most far place the cursor can get contains text - you need to hit enter :) But only once, otherwise git diff will show you read lines for everything that goes extra. Before commit you do git diff, let's say in git gui. You should have no warnings of "no newline at end of file" and no red lines. Something like this.

All 11 comments

@gingerkirsch I added the ## Description line that was missing from the Issue template you adapted ;)

Thank you for reporting this, I was aware that this could be done but never got the chance to create this.
I will make this a "First Timers Only" issue 馃帀

Hey @gingerkirsch! I'd like to take up this issue, can you assist me on how I can go about solving it? i.e. How do I search for files with the "no new line at end of file" issue? Thank you in advance!
^I guess you can tell that I am pretty new to all this haha, I'd really appreciate any help/guidance

Hello @KING-SID , so you should check all files and then place the cursor in the end. Imagine a text file - if you walk down with cursor and can reach a separate line with no text means the file is correct. If the most far place the cursor can get contains text - you need to hit enter :) But only once, otherwise git diff will show you read lines for everything that goes extra. Before commit you do git diff, let's say in git gui. You should have no warnings of "no newline at end of file" and no red lines. Something like this.

@gingerkirsch did you assign this issue to @KING-SID or is it free

@Chromicle this is a first timers only issue, you have a PR already in place and I'm thinking it's valid not sure, I have to check it later. So please choose issues not labeled as "First timers only"

@gingerkirsch Thanks for letting me know, I will get right to it! How do I get assigned to a task?

@KING-SID you should request to work on this feature and then it is up to maintainer to decide if you can proceed with it or not.

@gingerkirsch Thanks for letting me know!

To the maintainers:
I would like to work on this feature, kindly let me know if I can proceed with it. It's relatively simple and I think it would be a great way for me to begin contributing to Systers!

Hello! I would like to take up this issue. I am completely new to this so can someone please help me out in figuring out how to go about this.??
Thanks in advance!!

Hey @gingerkirsch @isabelcosta I have submitted a pull request that solves the issue. What are the next steps to getting it reviewed and merged? Please give me any feedback that could help me improve the PR if it is lacking in any way. Thank you!!!

Fixed on PR #191

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dilu9218 picture Dilu9218  路  9Comments

annabauza picture annabauza  路  6Comments

jddeep picture jddeep  路  6Comments

ghost picture ghost  路  5Comments

iofall picture iofall  路  7Comments