Skip to content

Conversation

@markekraus
Copy link
Contributor

@markekraus markekraus commented Dec 9, 2017

PR Summary

Reference #5610

PR Checklist

Note: Please mark anything not applicable to this PR NA.

return GetEncodingOrDefault(charSet);
}

internal static Encoding GetEncodingOrDefault(string characterSet)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@markekraus We could consider to change the default to Utf8 in later PR.

using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
using Microsoft.Win32;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like we don't. Should I remove it in this PR or in another?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Better in next - the PR is very large :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added it to the task list in #5610

--********************************************************************/

using System;
using System.Collections.Generic;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The file is not sorted but I agree to merge "as is" - if we'll have follow formatting PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@iSazonov I'm confused. This file is sorted. What is out of order?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Line 67.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah. that one can probably be fixed with automatic property { get; private set }, which is on the checklist already.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@markekraus Pow("Please", 10) make the follow PRs as small as possible - split work by file/type formattings. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@iSazonov if you have ideas on how the work should be split, please update #5610. I still don't have a good handle on what is too big or too small and, honestly, sometimes the feedback on that is inconsistent.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@TravisEz13
Copy link
Member

  1. If you have enabled styleCop, can you enable https://www.codefactor.io on your branch so I can see that your changes improve the style?
  2. Such a large amount of code was changed, I have to take your word that no logic was changed. Can we break this up into smaller PRs to get this done? The following are ideas on how to break it up:
    • Perhaps merge the partial classes without sorting ( should be easy to review )
    • Sort using statements (should be easy to review)
    • Sort various element attempting to keep under a line limit (I would complete at least one file.) The link @iSazonov suggested says 400.
    • Sometimes between coworkers, we use commits for breaking up reviews

@markekraus
Copy link
Contributor Author

@TravisEz13 I actually haven't enabled stylecop. I tried but couldn't get it to work. I believe it would apply to the entire utility assembly which would make it very hard to track down just the web cmdlet code issues. This was all somewhat beyond me. So I resorted to sorting the code manually and using the stylecop rules as guidance. We can't use them all as, for example, our contributor guidelines say to group the private backing fields with public properties. that will make it hard to see what private field and private-before-public sorting issues are actually issues.

I can break it up, yes. I tried breaking up a large change into the multiple commits in a single PR before, but @iSazonov didn't like that. I don't care how the work is broken up, but I could use some guidance, clarity, and consistency. I can be told one thing in a PR/issue, follow that to the letter in a new PR, and then have reviewers telling me to redo it a different way. This pattern has repeated several times and results in a lot of wasted time for all involved.

So, should I break this out into separate PRs? Or should I do multiple commits in a single PR or should I group a few commits in a few PRs? Should I move the files first? start with the partial class merges?

@TravisEz13
Copy link
Member

@markekraus Can you point me to the previous PR with the objection from @iSazonov ?

@markekraus
Copy link
Contributor Author

#5518 (comment)

@TravisEz13
Copy link
Member

I think we should try to take an incremental approach. One of the reasons to enable codefactor.io on your branch (maybe we should enable it after 6.0.0 is released) is to show that the PR was an overall improvement (did not introduce more issues than in removed,) not to say that you have to fix every issue.

I reviewed this link (https://smartbear.com/learn/code-review/best-practices-for-peer-code-review/) further and I agree with the line limit and the reason behind it. I spend an hour reviewing this PR and completed a few hundred lines.

Is there a reason that we cannot do a simple merge of the partial classes without any sorting (perhaps you could sort the using statements?) This seems like a good starting point.

@markekraus
Copy link
Contributor Author

Right now the pieces of the partial classes are in the same file. What constitutes a simple merge in this case? do I just move that code so it's in the same class brackets at the end of the class?

One reason why I was merging and sorting at the same time is that the classes are so out of alignment it's hard to even chose a logical place to move the partial code into. I can move the code directly in the end of the larger class, but then that code is all unsorted and that's sort of how it is now, only its in its own partial class block. If i try to move it with similar element types, I might have 2 to 3 places to chose from. If i try to move it to where it should be it will be out of place because the code around it is not where it should be.

@TravisEz13
Copy link
Member

Another approach would be to focus on a limited number of classes to keep under the line limit. I see one file that is over the line limit by itself. I'd say try this approach with the smaller files and we can proceed from there. @daxian-dbw @adityapatwardhan We should update the guidelines, but there should not be a requirement that a certain change is completed in a single PR unless splitting the change would have a negative effect on the project.

@markekraus
Copy link
Contributor Author

Ok. I'm going to close this PR so I can keep the branch for reference. I turned on codefactor.io, but I'm not real happy with the full read/write access it requires. I will work on smaller chunks per PR.

@markekraus markekraus closed this Dec 19, 2017
@markekraus markekraus deleted the SortWebCmdletsCommon branch January 19, 2018 18:59
@CarloToso CarloToso mentioned this pull request Feb 9, 2023
22 tasks
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.

3 participants