Skip to content

Applying consistant formatting across the project #1097

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

Merged
merged 1 commit into from
Jul 8, 2015
Merged

Applying consistant formatting across the project #1097

merged 1 commit into from
Jul 8, 2015

Conversation

whoisj
Copy link

@whoisj whoisj commented Jun 15, 2015

Attempting to clean up and standardize the formatting of the code in the project.

Looks very disruptive, but contains no logic changes.

  • White space usage
  • Brace usage
  • Indentation

@whoisj whoisj changed the title [WIP] Applying consistant white space formatting across the project Applying consistant formatting across the project Jun 16, 2015
@whoisj
Copy link
Author

whoisj commented Jun 16, 2015

/CC @nulltoken

(sorry this is so huge - I swear there are no logical changes)

@@ -14,8 +14,7 @@ public class RemoveFromIndexException : LibGit2SharpException
/// Initializes a new instance of the <see cref="UnmatchedPathException"/> class.
/// </summary>
public RemoveFromIndexException()
{
}
{ }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spacing between the braces is a tad strange in this file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whoisj Any chance you could fixup the commit? ^^

@nulltoken
Copy link
Member

@whoisj My head hurts a little bit, now 😉

Few questions:

  • How did you generate this? Through https://www.nuget.org/packages/CodeFormatter/ ? Would there be a way to add some .ps1 file that could be launched and automatically trigger the reformatting? (Note: Would that be possible, of course, it would be outside the scope of this PR)
  • Is there be a way to enforce a per line max length to avoid the horizontal scrolls when checking future diffs online?
  • Are you really ready to make every pending PR conflict and cope with the crowd hate? 😉

@whoisj
Copy link
Author

whoisj commented Jun 16, 2015

@nulltoken this was all done by hand, with loving care ❤️.

There's likely to be rather little PR collisions outside of a few files, and those collisions will be trivial to resolve (I've been testing against a few random PR which are pending).

So yes, I'm willing to help with confict resolves and manage crowd hate (as I think there will actually be very little). 🙏

@nulltoken
Copy link
Member

@nulltoken this was all done by hand, with loving care ❤️.

Wow! You're astonishing...

We somehow really need to automate this kind of process, later. /cc @shiftkey

@shiftkey
Copy link
Contributor

We somehow really need to automate this kind of process, later.

I think it's worth looking at repurposing CodeFormatter to suit - I did this for one of my projects, and aside from the VS2015 requirement it's pretty great.

octokit/octokit.net#807
shiftkey/Octokit.CodeFormatter#1

@whoisj
Copy link
Author

whoisj commented Jun 16, 2015

There are always tools like AStyle which are useful and do not require pre-release versions of Visual Studio to work. 😄

@whoisj
Copy link
Author

whoisj commented Jun 19, 2015

Is Travis on vacation today ? 🍹

@whoisj
Copy link
Author

whoisj commented Jun 30, 2015

This is what Astyle produces:

vNext...whoisj:astyle

@whoisj
Copy link
Author

whoisj commented Jul 2, 2015

@shiftkey I attempted to evaluate Octokit, but I can't even get the solution to load correctly let alone build or run. Could you set something up like I have for Astyle? 🙏

@whoisj
Copy link
Author

whoisj commented Jul 2, 2015

This is what Code Formatter produces

vNext...whoisj:codeformatter

@shiftkey
Copy link
Contributor

shiftkey commented Jul 2, 2015

I attempted to evaluate Octokit, but I can't even get the solution to load correctly let alone build or run.

Could this be due to the VS2015 requirement? I've held off on merging this PR into Octokit proper until it RTMs because of this...

@whoisj
Copy link
Author

whoisj commented Jul 2, 2015

Could this be due to the VS2015 requirement? I've held off on merging this PR into Octokit proper until it RTMs because of this...

I'm using VS2015, but I get this fun error about needing to "click on the project and choose download", but that's not an option. 😞

@shiftkey
Copy link
Contributor

shiftkey commented Jul 2, 2015

@whoisj weird, haven't seen that one before. could you open an issue over on the repo with some details so I can look into it when I get a chance?

@whoisj
Copy link
Author

whoisj commented Jul 8, 2015

Given the difficulties Octokit is having due to VS migration, and the semi-ugliness Astyle creates, do we want to just merge this PR?

@Therzok
Copy link
Member

Therzok commented Jul 8, 2015

Many PRs will become unmergeable, but sure.

/me silently curses this PR.

@nulltoken
Copy link
Member

Given the difficulties Octokit is having due to VS migration, and the semi-ugliness Astyle creates, do we want to just merge this PR?

@whoisj Could you fix in RemoveFromIndexException the spacing between braces?

Cleaning up white space usage

Cleaning up `using` statements

Cleaning up `cref` usage

Cleaning up parameter alignment

Cleaning up brace positioning
@whoisj
Copy link
Author

whoisj commented Jul 8, 2015

@whoisj Could you fix in RemoveFromIndexException the spacing between braces?

@nulltoken done. 😀

nulltoken added a commit that referenced this pull request Jul 8, 2015
Applying consistant formatting across the project
@nulltoken nulltoken merged commit 5dc5968 into libgit2:vNext Jul 8, 2015
@whoisj
Copy link
Author

whoisj commented Jul 8, 2015

🎉 🎈 🍰

@nulltoken
Copy link
Member

Thanks to you for having crafted this ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants