Closed Bug 1343975 Opened 3 years ago Closed 3 years ago

Remove dos/windows endline characters from C++ sources

Categories

(Core :: General, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(2 files, 1 obsolete file)

Our coding style guide requires:
> Unix-style linebreaks ('\n'), not Windows-style ('\r\n').
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Whitespace

I'm filing this bug to fix all dos/windows-style linebreaks in our C++ sources in the tree.  (I was prompted by an issue with some being nearly-reintroduced, over in bug 1339298.)
Attachment #8842998 - Flags: review?(ehsan)
Odd! For some reason mozreview is representing this diff as *adding a file called "commit-message"* with the contents of my commit message. That is not how it's shown in my MQ patch locally; no idea why it's causing that.

This "commit-message" file is shown e.g. here:
 https://reviewboard.mozilla.org/r/116740/diff/1/raw/
 https://reviewboard.mozilla.org/r/116740/diff/1/

I'll see if I can get that fixed, and then re-request review.
The corresponding "review summary" diff page does not show this "commit message" file, though...
 https://reviewboard.mozilla.org/r/116738/diff/1#index_header

Very odd.
Attached patch fix v1Splinter Review
RyanVM tells me the "commit-message" file is a MozReview implementation detail, from a recent change. *shrug*

In an abundance of paranoia, I'm going to just use a traditional bugzilla attachment here.

For review/auditing purposes, I've included the command that I used to generate the patch, which you can run locally to verify that your results match mine, if you like.  (It uses "fromdos" [from the tofrodos Ubuntu package.)

I've also verified locally that this is a purely whitespace change -- you can verify that by qimporting this patch and running:
  hg diff -w -r -2
Attachment #8842998 - Attachment is obsolete: true
Attachment #8843009 - Flags: review?(ehsan)
Attached image emacs-screenshot.png
(If you're interested in seeing the actual removal of the DOS newline characters, you can visualize them by opening the patch file in emacs and looking for "^M" special characters. Here's a screenshot of what that looks like for me, for the first chunk of the patch.)
Attachment #8843009 - Flags: review?(ehsan) → review+
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/77bb2c4461a3
Get rid of all dos/windows linebreaks in Mozilla C++ code. r=ehsan
https://hg.mozilla.org/mozilla-central/rev/77bb2c4461a3
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.