Skip to content

Ensure that all source files end with a single \n#4080

Merged
michaelficarra merged 1 commit intojashkenas:masterfrom
lydell:single-newline-at-eof
Sep 4, 2015
Merged

Ensure that all source files end with a single \n#4080
michaelficarra merged 1 commit intojashkenas:masterfrom
lydell:single-newline-at-eof

Conversation

@lydell
Copy link
Collaborator

@lydell lydell commented Sep 3, 2015

This was done by first checking all files in the repository root by hand, and
then by doing the following:

$ npm i get-stdin@4
$ cat clean.coffee
fs = require 'fs'
stdin = require 'get-stdin'

stdin (text) ->
  for file in text.trim().split('\n')
    contents = fs.readFileSync file
      .toString().replace /\s*$/, '\n'
    fs.writeFileSync file, contents
  return
$ ls !(node_modules)/**/*.coffee | coffee clean.coffee

Ideally merged after #4079.

This was done by first checking all files in the repository root by hand, and
then by doing the following:

    $ npm i get-stdin@4
    $ cat clean.coffee
    fs = require 'fs'
    stdin = require 'get-stdin'

    stdin (text) ->
      for file in text.trim().split('\n')
        contents = fs.readFileSync file
          .toString().replace /\s*$/, '\n'
        fs.writeFileSync file, contents
      return
    $ ls !(node_modules)/**/*.coffee | coffee clean.coffee
michaelficarra added a commit that referenced this pull request Sep 4, 2015
Ensure that all source files end with a single `\n`
@michaelficarra michaelficarra merged commit 8711da0 into jashkenas:master Sep 4, 2015
@michaelficarra
Copy link
Collaborator

Thanks.

@lydell lydell deleted the single-newline-at-eof branch November 2, 2015 06:58
EsrefDurna pushed a commit to EsrefDurna/coffeescript that referenced this pull request Nov 12, 2025
Ensure that all source files end with a single `\n`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants