Add .editorconfig file
When merged, this will add an .editorconfig file to the repo to help enforce a consistent coding style. The following rules are set:
- Add final newline and trim trim trailing whitespace from all files
- Use 4 tabs instead of spaces and crlf line endings in .lua files
Did commit https://github.com/multitheftauto/mtasa-resources/commit/2c6416a09697b9d8b812c182cff0955b09d753c5 standardize the repo on LF or CRLF? If LF, then I should update my settings here I think. Also, is there any way to perform a "simpler" format checking at just checks for proper indentation and line endings? That seems to be the most common pain point.
Unfortunately I think it accidentally accidentally changed it to CRLF. It seems to edit all admin2 files, which iirc were previously standardised to LF by lua-fmt. I'm going to turn on pull request enforcements so we can catch this in code review next time.
Also, is there any way to perform a "simpler" format checking at just checks for proper indentation and line endings?
I think we could do that. Do you want to look into that, or shall I?
I think we could do that. Do you want to look into that, or shall I?
I have zero experience with GitHub Actions/CI so it's probably best if you look into it.
Looks like you're correct: .gitattributes calls for LF line endings.
If we can get consensus on the settings I've defined so far I'll go ahead and add a CONTRIBUTING.md file describing the desired coding style so far.
A seperate PR to format existing code is probably called for too.
Oh, hm, if our .gitattributes calls for LF, and most of our current code is CRLF, I'm not sure what to do.
Maybe we can just comment out that line of the .gitattributes file, and revisit line endings (and mass-formatting) later.
I think that's probably the best move for now. I'll open a separate issue for discussion.
Going to switch this back to a draft PR until we make some more decisions in #250