GeoJSON-Net / GeoJSON.Net.Contrib

Repository for all GeoJSON.Net *.Contrib projects
MIT License
36 stars 22 forks source link

Update formatting #33

Closed milang closed 4 years ago

milang commented 4 years ago

This is the last pull request in my "PR stream" 🙂. It is an optional change that improves consistency of the text files in the repository.

Some text files currently use LF (UNIX newline convention) while others use CRLF (Windows newline convention). I added .gitattributes file that makes newline handling consistent regardless of git client settings of future contributors. With this change all text files are stored with LF newlines in the repository (git being a UNIX tool, it is happiest with UNIX newline convention). Newlines in all text files get translated to CRLF when checking files out using Windows git client. git will also normalize all text file newlines back to LF when creating a commit.

Because of this many files in this PR's GitHub diff log show that every line has changed even though there are no actual changes (other than newlines). I recommend using the "ignore whitespace" comparison flag.

True to our never-ending programmer discussion of "tabs vs spaces" 😉, some files in the repository were using space indentation while others were using tab indentation. The accepted .NET code standard is to use 4-space indentation, so I converted all tab-indented files back to spaces. To improve future consistency, I added .editorconfig file that is recognized by all major IDEs (Visual Studio Code with EditorConfig extension, Visual Studio 2019 natively, JetBrains Rider natively). This file will enforce space-indentation in all text files, strip trailing spaces (lines of code that have pointless "invisible" spaces past the last character), make sure files have a final newline (line-oriented tools work better with text files that have a final newline).

Finally I reformatted some of the files to use consistent indentation (especially when creating new class instances) and removed unused using statements.