-
Notifications
You must be signed in to change notification settings - Fork 79
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
Code reformat PSR2 #54
Comments
This is unlikely to occur as the code is relatively stable and while not necessarily PSR2 it is at least consistent, and there wouldn't be any real benefit in taking this on, and it would require a ton of testing which I don't think our coverage tolerates at this point. Will consider PRs but it would take a fair amount of convincing and that PR would need to be accompanied (or preceded) by some serious testing coverage increase. |
@brianjmiller The real benefit to taking this on is giving people a style model that they can follow. Even though the code is consistent we have to infer what the style is instead of being told what the style is. This only increases the margin to which someone could get it wrong. Beyond that if the guidelines were laid out then they wouldn't be consistent with those that people generally try to follow (being PSR1 & PSR2) so you give more for people to learn in order to work on your product. It seems like using PSR1 & PSR2 and having an automated tool such as StyleCI check your PR's for you will fit fine. |
@WillSkates oh, I know the reasons trust me, and that is a great suggestion for a non-distributed library or one with excellent test coverage, unfortunately I feel like that ship has sailed as the library is widely distributed and doesn't have good enough test coverage to adequately test a sweeping style change. For the size edits that are occurring it really shouldn't be difficult to look at the rest of a file and conform, and the potential for instability isn't worth the small gain offered by switching to a different style, particularly since we're already consistent. If people want to contribute the best thing to do is to improve the test coverage. |
@brianjmiller There is no sweeping (i.e. wide range or amount) style change provided by PSR2 that would affect your downstream users. The only way that PSR2 would affect this is by changing the names of your classes and/or methods that are publicly visible. In PSR2 could change the ways that the names of things are written in two ways:
The problems with upgrading the publicly visible interface to PSR2 come in where the lib is not consistent:
It should be fine to move to PSR2 for the next major version bump you stated. We can also aim for 100% code coverage as well. |
The problems I'm concerned about aren't the public interface changes, it is the sheer amount of change and the potential for human errors to happen that destabilize the lib, which begs the question of whether or not someone has done it. If it is a small change to a couple files then that's one thing, but if we're talking about adjusting whitespace handling around every operator in every function in every file (which is intended as a "style change" example) then I'm just not interested as it just isn't worth the risk. |
@brianjmiller I know. I didn't think that their would be anything that could cause significant issue. That was my intuition however so I went back and checked. Essentially what we are looking for is lines of code that cant be fixed automatically (either named incorrectly or longer than 120 characters) and aren't covered in the test suite. By my count there are two lines (2/1429): In order to reach that conclusion I.....
Both of those lines are longer than 120 chars (162 and 141 respectively). That's the only issue with them. The change needed is to either concatenate or multi-line split the string that's being passed. There's no logic change there and they are both very easy to check for now that we know what and where they are. Does that give you a bit more confidence that the change isn't as impact-ful as you believed? |
Just suggestion: I think It would be nice and more cleaner if the code will be formatted using PSR2.
The text was updated successfully, but these errors were encountered: