Giter Site home page Giter Site logo

Comments (8)

balupton avatar balupton commented on May 27, 2024

Why is it needed for git and vim? Never had an issue before with git.

from projectz.

hvoecking avatar hvoecking commented on May 27, 2024

It's actually a unix thing I just mentioned these tools because that's where for me the newlines are relevant:

  • If you open a file in vim and save it (no matter if you modified it or not), it automatically appends a newline (therefore you always have a diff at the end of the file, even if you did not actually change something in the file).
  • Git (and github) complain if you remove the newline at the end of the file in a commit, see eg. this commit.

from projectz.

mightyiam avatar mightyiam commented on May 27, 2024

👍 Vim makes the same newline for me, as well.

This is like EditorConfig's insert_final_newline = true.

It shouldn't remove a newline, if one exists. It shouldn't add one, as well, FWIW.

from projectz.

balupton avatar balupton commented on May 27, 2024

It shouldn't remove a newline, if one exists. It shouldn't add one, as well, FWIW.

Good idea. Will see what we can do. @pflannery do you want to grab this one?

from projectz.

pflannery avatar pflannery commented on May 27, 2024

@balupton Im guessing this is just a matter of adding a new line during "Save package files" like data = JSON.stringify(@dataForPackagesEnhanced[name], null, ' ') + '\n' ??

(Shame we cant reference line number to projectz.litcoffee files)

from projectz.

pflannery avatar pflannery commented on May 27, 2024

It shouldn't remove a newline, if one exists. It shouldn't add one, as well, FWIW.

I've determined that both npm and bower (init, --save and --save-dev) append an LF to the file so I don't think its worth the extra effort in trying to detect if an LF wasn't present originally. Instead my PR just does what npm and bower do and that's append an LF to the end of the JSON

from projectz.

mightyiam avatar mightyiam commented on May 27, 2024

Instead my PR just does what npm and bower do and that's append an LF to the end of the JSON

Great

from projectz.

mightyiam avatar mightyiam commented on May 27, 2024

Thank you.

from projectz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.