How to fix “No newline at end of file” warning for lots of files?

前端 未结 11 1845
抹茶落季
抹茶落季 2020-12-03 01:48

I have a huge number of source files that are all lacking a newline at the end.

How do I automatically add a newline to the end of each of them?

Some may alr

11条回答
  •  没有蜡笔的小新
    2020-12-03 02:35

    After finding the tool do this job with no luck. I decide to write my own

    This is my python script to do that job

    It only append (\r\n) to file not contains (\n) at the end of file

    https://github.com/tranhuanltv/append_newline

    Usage: append_newline.py .c ./projects ./result_dir

    Make Pull Requests if you want to

提交回复
热议问题