Bug 125424 - check-webkit-style should check for extra newlines at EOF
Summary: check-webkit-style should check for extra newlines at EOF
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-08 11:43 PST by Brian Burg
Modified: 2013-12-09 10:58 PST (History)
5 users (show)

See Also:


Attachments
patch (4.65 KB, patch)
2013-12-08 13:28 PST, Brian Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2013-12-08 11:43:39 PST
It currently checks if there is no newline, but won't complain if there are several newlines at EOF. There should only be one, at least for CPP files. There may be some other constraints for other formats like Cmake that I don't know about.
Comment 1 Brian Burg 2013-12-08 13:28:00 PST
Created attachment 218710 [details]
patch
Comment 2 László Langó 2013-12-09 00:14:59 PST
This will log both errors when there is no new line at the and but there is a blank line before it. This is confusing.
Comment 3 Brian Burg 2013-12-09 00:19:57 PST
(In reply to comment #2)
> This will log both errors when there is no new line at the and but there is a blank line before it. This is confusing.

I'm not sure what test case you are describing. Can you give a concrete example? (It's entirely possible that this extra-newlines-at-EOL check should just be merged with the missing-EOF-newline check)
Comment 4 László Langó 2013-12-09 00:26:17 PST
(In reply to comment #3)
> (In reply to comment #2)
> > This will log both errors when there is no new line at the and but there is a blank line before it. This is confusing.
> 
> I'm not sure what test case you are describing. Can you give a concrete example?

example:
//firstline \n
//secondline \n
\n
//last line

This will log both errors, because there is no new line at the end, but there is a blank line before it.

> (It's entirely possible that this extra-newlines-at-EOL check should just be merged with the missing-EOF-newline check)
I think the merge is a good idea.
Comment 5 WebKit Commit Bot 2013-12-09 10:58:12 PST
Comment on attachment 218710 [details]
patch

Clearing flags on attachment: 218710

Committed r160319: <http://trac.webkit.org/changeset/160319>
Comment 6 WebKit Commit Bot 2013-12-09 10:58:14 PST
All reviewed patches have been landed.  Closing bug.