Add trim_trailing_whitespace to .editorconfig [skip ci]#1332
Add trim_trailing_whitespace to .editorconfig [skip ci]#1332seanmcleod70 merged 2 commits intoJSBSim-Team:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1332 +/- ##
=======================================
Coverage 24.91% 24.91%
=======================================
Files 169 169
Lines 19675 19675
=======================================
Hits 4902 4902
Misses 14773 14773 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Well, I have set VS Code to automatically trim trailing spaces on savingno matter what the file extension is. However I guess that for
Indeed, I guess I've used the default indent of VS Code (i.e 4 spaces) for the first Python files I've created. I have this impression that, generally speaking, 4 spaces is quite standard for Python whereas C and C++ are more in the "2 spaces" team. |
|
Okay I've pushed a commit to add an entry for Python files to Also used a trailing
Must say I always found the JSBSim standard of only 2 spaces much smaller than I was used to for all the other C++ code I'd worked on where it was more on the order of 3-4 spaces. One of the reasons I originally added |
Ah OK. I had this impression because C++ is quite verbose, especially when using templates, and that using 2 spaces indentation would help to avoid hitting the 80 columns limit which is AFAIK another standard limit that is used for code formatting. |
|
And the PR looks good to me 👍 |
…1332) Co-authored-by: Sean McLeod <sean@seanmcleod.com>
@bcoconni mentioned:
So I've added
trim_trailing_whitespace = trueto.editorconfigto try and improve consistency. Not guaranteed since someone may use an editor that doesn't support.editorconfig. If we did want to guarantee this sort of formatting we'd need to use some tool tied to our CI pipeline.@bcoconni your examples of removing trailing whitespace were for Python code in .ipynb files. I noticed that currently our
.editorconfigis only configured for.h .hpp .cppfiles. So I guess we should also add an entry for.pyfiles? Looks like our default there is space for indents, but 4 spaces as opposed to 2?