-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add GitHub action to automatically add EOL @ EOF #4485
base: main
Are you sure you want to change the base?
Conversation
I wonder if fixing that automatically is desirable in the first place. Among the things this repo contains are test cases for the language extractors. It feels plausible that we'd want some of the test inputs to lack terminating newlines, such that parsing and location reporting in those cases can be exercised. |
You can specify an list of files to ignore in the config. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by comments: this 2.5 year old PR has grown stale wrt. best Action practices.
221acc5
to
46dae63
Compare
136e2f8
to
0fa88ee
Compare
0fa88ee
to
cccf2cb
Compare
@esbena PR has been updated to address concerns |
One thing to note is that the POSIX is about portability across operating systems. It has nothing to do with programming language specifications. The questions of "what is a line" and even "what is a character" vary between programming languages. For example https://262.ecma-international.org/8.0/#table-33 . I'm all in favour of automatically formatting source files, and quite like having newline characters at the end of files. However, I'm not sure we want to enforce this. Another things to note:
I think most of our files are UTF-8, so this shouldn't be too much of an issue. |
The other thing that I notice is that, many IDEs or anyone that has an By enforcing this org-wide will mean that it's finally consistent |
According to how the posix standard defines a line
Thus, many of the files in this repository that don't contain a newline at the end of the file contain a file where the last line isn't, according to the spec actually a line.
This GitHub action resolves this issue by automatically adding a End of Line (EOL) @ End of File (EOF).