Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2015

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
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