Skip to content
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

Support insert_final_newline #75

Open
chapmandu opened this issue May 15, 2020 · 1 comment
Open

Support insert_final_newline #75

chapmandu opened this issue May 15, 2020 · 1 comment

Comments

@chapmandu
Copy link

Correct me if I'm wrong but cfformat seems to always create a final newline at the end of files.

This can become a problem when trying to prevent whitespace.

It would be great to have some sort of "insert_final_newline": true/false setting.

@jcberquist
Copy link
Owner

The newline at the end of the file is a result of the way blocks and opening to closing tags (e.g. <cfcomponent></cfcomponent> are formatted. I could update the formatter to trim what it gets back before writing to the file, but I will need to think about whether I want to allow files that don't end with newlines. I personally don't like files that don't end in newlines, since I think of it as the line terminator. Github in fact renders such files with a little red icon indicating the missing newline (as I am sure you know).

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

No branches or pull requests

2 participants