-
Notifications
You must be signed in to change notification settings - Fork 37
[FNA] [HARD] FNA Code Style: Tabbing, etc. #147
Comments
Taking |
To anyone else willing to take a look at the other directories listed here, I've brewed a few one-liners that may help the effort. |
Thanks, meklu - I'll check those out before I jump in here. |
I'll take |
Quickie: Kill trailing whitespace, or whitespace in blank lines: Hopefully I'll get time to actually work on this tomorrow, today was very busy - and tonight just as much. |
A good check for line length is to run the You can use this bash script to do it for the current directory: |
Why not just |
I see that works too. I never tried file with a wildcard. |
Shells in *nix expand wildcards before passing them to the command, so wildcards will work with any program that can take a list of files as input. |
Thanks. I didn't realize the shell handled that part of the wildcards. |
You're welcome. Shell expansion is an interesting and powerful feature, but it's good to be aware of what it's doing automagically because it means that programs/commands never see the wildcards (which is why you can't just do a mass rename with the mv command). Now... if only I knew 1/10th as much about how git branches are supposed to work. :) Guess I'll pick it up as we go. |
I'll take on |
Will take |
I'll continue working my way up the list and take |
Also going to be taking |
Just pushed a large chunk of cleanup for This cleans up all files except for the following:
If anyone wants to take some of these files, feel free. Everything else should be nice and clean now. |
I can knock out |
I'll leave |
If I'm not too busy, I might grab Input or the rest of Graphics tomorrow night. But if I haven't responded again by the time you're ready to start it, then go for it @3vi1 . I've been really busy this week, so I might not get a chance to contribute this week. |
Since no one else has claimed it yet, I'll take Input now. |
That's cool. I'm going to be really tied up with my job at least until Sunday. I'll see what I can help with at that point. |
…terCapabilities.cs to GamePadDPad.cs should be mostly done. Others are partially done.
I'll take what's left of |
What's the official stance on stuff like this: Kill the comment or let it be? And also, if it stays, change it to /* */ style? |
I believe those are actually supposed to be XMLdoc summaries. So it should probably be this:
Though I don't know if that's 100% correct... look around the source (or possibly SDL2#'s source) and see how the XML tags are meant to work. Don't remember off the top of my head. |
XML tags require three /// before them: http://msdn.microsoft.com/en-us/library/b2s063f7.aspx |
[FNA] #147 cleanup and tabifying of remaining Graphics/ files
The only unassigned task left is |
I'll start at the bottom and take:
|
Up until now I've been swerving a bit on this, but thinking about it, you're right, we probably should remove those. I'll double check all the old stuff when I do my second FNA pass, but from now on, go ahead and remove those bits. |
[FNA] #147 tabbing and cleanup of ./BoundingBox to Curve, plus undo a for to foreach change in Graphics/SpriteBatcher
Getting ContainmentType and CurveContinuity. Just a couple small enum files. |
I'll continue working my way up and do ./I* - M* tonight.
|
If you want you can add this to your current PR while you fix the current issues in that one, I'd be cool with that. Looking at that list, only Matrix seems to be the real beast in there. |
Will do. It will probably be sometime tomorrow before I add them to the pull. I only got about halfway through Matrix as I spent half the night distracted with troubleshooting unrelated issues (Today's Ubuntu Trusty repo updates killed sound and broke KDE's 3D compositing... yippee). |
I'll start these today. (4 of them will be really easy.) |
We've done two passes through Matrix.cs (3vi1 and myself), if someone wants to do a third/fourth pass through that file, consider that one perpetually open. It's probably the largest file in the MonoGame project in the worst way possible. You probably want to do a side-by-side comparison with the original while you're doing it: https://github.com/mono/MonoGame/blob/develop/MonoGame.Framework/Matrix.cs |
I guess all that's left is for me to take:
I'll see if I can't knock these out this morning before taking the son to see the new Captain America movie. Edit: missed the GameComponent files at first due to ls sorting != MonoDevelop sorting. |
Well those went pretty quick. Once EHCP finishes what he has in progress, the root will be done! |
We're down to the very last file in our first pass of style cleanup, and hilariously enough, it's Joe's done the pass, but I've not reviewed it yet: https://github.com/flibitijibibo/MonoGame/pull/192/files#diff-7 Will try to review this today/tomorrow, but if you want to take a look at it yourself, feel free to do so. Like Matrix, it's kind of a massive file for lots of nasty reasons (many of which I intend to fix as soon as we're done with this task). We're so close to being done with the first wave of FNA transition tasks! |
[FNA] #147 first pass at cleanup for ./ CurveKey to Game
We finished the last task! While the code is certainly not perfect, it should be much easier to understand and edit now. I will be adding the second wave of tasks this week. |
Completes Issue flibitijibibo#194. Minor corrections for Capitalization, spelling, punctuation, and line-length. Some non-comment lines that slipped through on Issue flibitijibibo#147 have also been updated for line length (only).
Completes Issue flibitijibibo#194. Minor corrections for Capitalization, spelling, punctuation, and line-length. Some non-comment lines that slipped through on Issue flibitijibibo#147 have also been updated for line length (only).
…terCapabilities.cs to GamePadDPad.cs should be mostly done. Others are partially done.
… - this commit will be for more "structural" changes. more white space and tabbing fixes will be in separate commit
…, fixing long lines, plus other random things I missed on first pass
…e-sdl2 [FNA] flibitijibibo#147 cleanup and tabifying of remaining Graphics/ files
Difficulty: This task is considered a HARD task. If MEDIUM tasks separate the men from the boys, HARD tasks separate Dark Souls fans from actual serial killers that wear proper armor for reasons yet to be explained.
Ordering: This task should occur AFTER removing unused defs! See #145 before taking a folder here.
One of my favorite features of the MonoGame source is that the tabbing/formatting is fucked. I hesitate to blame any specific dev for this, not because of a mass of incompetent MonoGame devs, but because of a mass of incompetent IDE developers. I swear, I have yet to understand the black magic that decides how MonoDevelop tabs your files.
So while we're fixing this problem, we're going to establish a strict text format that should help make the source significantly more readable.
Here are the rules:
i++/i--
: Doi += 1
andi -= 1
instead unless the increment is genuinely being used to its advantage. If it's that painful to do this, considerforeach
instead.var
! Use the actual type name!someMethod()
rather thansomeMethod ()
,someArray[x]
rather thansomeArray [x]
, etc.(Type) cast
rather than(Type)cast
.// This code is derp
rather than//this code is derp.
/* */
blocks, rather than multiple lines of//
.How I split up lines:
When in doubt, look at a folder that's been completed.
When tabs start getting crazy, you're likely going to want to check with
git diff
or various text editors to be sure that what you've got is correct. MonoDevelop in particular likes to be totally insane about '\t' tabbing sometimes, so while it might look like tabs are aligned in MonoDevelop, a sane text editor will probably tell you otherwise.In addition to fixing the style, you're going to find that you're cleaning up a lot of extra stuff on the way... bizarre trailing whitespace will likely become your personal favorite, if interleaved tabbing styles does not win your heart. That said, try to keep the actual code the same. Only change the actual code when you're 100% sure that what you're changing is essentially a no-op change.
Remember, this is the hardest task on the FNA transition list. Assume the absolute worst before you start.
But, note that this is all that you have to change. Everyone else can deal with license headers, line endings, and all that other stuff, assuming you don't do this yourself.
Now, on to the files in question.
The following folders need work:
M - Content/- Completed by @meklu 93fd738M - Content/ContentReaders/- Completed by @meklu 93fd738H - Graphics/- Completed by @extrahotchilipowder de44018 and flibit 9569acb 252b6b9M - Graphics/PackedVector/- Completed by flibit cb8157cM - Graphics/Vertices/- Completed by flibit c9ecd31E - Input/- Completed by @khbecker d42d412 and flibit 6d87b6d ea25e90E - Input/Touch/- Completed by @3vi1 09c633d with additions by flibit 3ecd0adE - Media/- Completed by @3vi1 741baf3 with additions by flibit c740616E - Storage/- Completed by @3vi1 38edaa5 with additions by flibit bd7d2d2H - ./- Commits: 5e8b527 c902210 cb7fd61 c69880c 0a4ecb2 a671673 24f1eb3 37ba458 be42238 80b47e7 7aa9e27E - Easy. Probably still work, but nothing deadly.
M - Medium. Things start to get ugly here.
H - Hard. I hope you're proudly unemployed while you're doing this.
The following folders have already been completed, and should be used as references:
Audio/
Graphics/States/
SDL2/
The following folders are NOT to be touched. This is because we need to keep MonoGame compatibility, or because it will be dealt with in a separate project:
GamerServices/
Graphics/Effect/
Graphics/Shaders/
Net/
Properties/
Utilities/
If you decide to take a folder, please post here and let us know you're working on it. Because we're doing so much work on so much code, we need to be sure we're not conflicting with other branches. Be sure to check ALL [FNA] issues before taking on a folder!
The text was updated successfully, but these errors were encountered: