joomla / coding-standards

Joomla Coding Standards Definition
https://developer.joomla.org/coding-standards/basic-guidelines.html
GNU General Public License v2.0
128 stars 129 forks source link

[META] Finalizing PHPCS 2.x support #143

Open mbabker opened 7 years ago

mbabker commented 7 years ago

Extracted from https://github.com/joomla/coding-standards/pull/109#issuecomment-268876448

photodude commented 7 years ago
photodude commented 7 years ago

@mbabker where do you think the example xml files for selectively applying rules should live in the repo?

Added in ExampleRulesets via #152

photodude commented 7 years ago
photodude commented 7 years ago

Just notice this new issue with InstantiateNewClasses fixer as shown in the InstantiateNewClassUnitTest If we instantiate a New Class as $k = new self(); we end up with $k = new ; See https://travis-ci.org/photodude/coding-standards/jobs/200657756

InstantiateNewClass issue has been fixed, Thanks @wilsonge

we also have a bunch of Missing @package tag in file comment (Joomla.Commenting.FileComment.MissingPackageTag) issues now being reported as of phpcs 2.7.1+ fixed in #150

photodude commented 7 years ago

As best I can tell the ControlStructuresBrackets sniff issues are related to the section that deals with bracket indenting. https://github.com/joomla/coding-standards/blob/phpcs-2/Joomla/Sniffs/ControlStructures/ControlStructuresBracketsSniff.php#L148-L192

Likely in the str_repeat() with tabs~

ControlStructuresBrackets sniff issues have been fixed, Thanks @wilsonge

photodude commented 7 years ago

@wilsonge Are you still up for helping to work on these issues so we can move forward with the Alpha release?

~~This is the Branch I'm working with to try and create a PR to solve these issues. https://github.com/photodude/coding-standards/tree/patch-2~~

photodude commented 7 years ago

@rdeutz If your interested, this is the current list of Items to address with the PHPCS2 branch for a public alpha release of the updated standard with autofixers.

photodude commented 7 years ago

@nibra, @810, @vess if you are interested in continuing to follow the path to a public alpha release for the PHPCS2 branch, or contributing to fixing any of the issues in the PHPCS2 version of the standards prior to the alpha release this is issue to follow.

wilsonge commented 7 years ago

I very much am!

wilsonge commented 7 years ago

I've done fixes for the InstantiateNewClasses and the ControlStructuresBrackets for the patch-5 (i made them against patch-2 like you asked - but locally been testing against patch-5 given that was where your unit test was running against that you linked to) branch and then the package tag warning looks correct to me

photodude commented 7 years ago
photodude commented 7 years ago

added a number of fixes see

photodude commented 7 years ago

Still need to

after that, I think the other review items can happen with the public alpha

photodude commented 7 years ago

@mbabker @wilsonge Once we merge PRs 150-153 we just need to add composer instructions and we are set for the Alpha release. All other items are changes to the existing ruleset or are review items that can be handled with the alpha release.

wilsonge commented 7 years ago

I've merged #150, #151 and #152. I want to have a quick look over #153 later today to convince myself that it is the best solution :)

photodude commented 7 years ago

Thanks @wilsonge.

photodude commented 7 years ago

I've added some composer install information (based on the framework composer instructions)

photodude commented 7 years ago

With the merge of #153 we can check off the first item about dealing with the adjusted messages. That leaves the review items and the proposed change to adopt the PSR-2 multiline class params.

How do we want to proceed with those items and making the official Alpha release?

mbabker commented 7 years ago

Added a task on merging the manual to the right branch too since that's no longer in a self-contained branch (more of a reminder than anything since the dev site will read the manual from the master branch).

photodude commented 7 years ago

I think there are also some changes to the IDE section in the Master branch that will need to be merged into the into phpcs-2 as well.

wilsonge commented 7 years ago

So with merging #153 where does that leave us here?

photodude commented 7 years ago

The blog post needs to be finalized, @wilsonge have you reviewed the draft of that?

Dev Blog post

wilsonge commented 7 years ago

Blog post looked good to me :)

photodude commented 7 years ago

@mbabker Are we good now to release the public alpha?

photodude commented 7 years ago

Custom Sniffs Review

photodude commented 7 years ago

I have completed a review of our custom stiffs against the PHPCS core sniffs they are based on, (as best I could tell) Details of the review are posted above, and PR's have been opened for the related changes.

photodude commented 7 years ago

@mbabker what is the plan on releasing the public alpha?

mbabker commented 7 years ago

I'm working with my marketing liaison on getting the blog post scheduled for publishing (hopefully this coming week) then we'll sort out a timeline.

mbabker commented 7 years ago

Blog is scheduled for tomorrow.

photodude commented 7 years ago

Any thoughts on merging PR https://github.com/joomla/coding-standards/pull/159

photodude commented 7 years ago

@mbabker with the blog post scheduled for tomorrow what is the plan on tagging the alpha release?

mbabker commented 7 years ago

I'd say the next week or two.

photodude commented 7 years ago

I attempted to sync the master changes over to the phpcs-2 branch, but I definitely did something wrong in git and broke the branch I was making the attempt on. I'm starting to think the two branches have diverged too much and we'll just have to cherry pick the commits we want to bring over. Then again, maybe someone who is better skilled at git could make the rebase/merge sync from master to phpcs-2 without breaking everything like I did.

wilsonge commented 7 years ago

I think I can help with this :) You can't rebase. But I think merging gives not-so-bad conflicts at a very quick glance? Is there a time we can skype and I can help you with this?

photodude commented 7 years ago

@wilsonge that would be great. We got about a 6 hour time difference to figure out for scheduling (and I've never skyped) I have some additional availability this week I'm sure we can work something out. Do you have my email (or twitter) for direct messaging?

photodude commented 7 years ago
photodude commented 7 years ago

With PR #168 and PR #167 are we good to finalize the change over?

photodude commented 7 years ago

Are we good to go with a tagged alpha release now?

rdeutz commented 7 years ago

a while ago I created this https://github.com/joomla-projects/docker-joomla-cms-phpcs for the 1.x code styles, I think it should be easy to tweak it to use the 2.x code styles. So we could let them run side by side and compare

wilsonge commented 7 years ago

Go for it :)

photodude commented 7 years ago

@rdeutz I recommend using the example sub-ruleset for the CMS that is included with the 2.x version in the master branch. https://github.com/joomla/coding-standards/tree/master/Joomla/ExampleRulesets/Joomla-CMS/ruleset.xml

This sub-ruleset will exclude the portions of the CMS that are not tested. more details are in the readme https://github.com/joomla/coding-standards#selectively-applying-rules

photodude commented 7 years ago

Are we good to go with a tagged alpha release now? The review items can happen during the Alpha release.

photodude commented 7 years ago

@mbabker please check off "Merge coding standards manual", that has been completed.

The last item listed for review is the review for consistency with the old ruleset, this is something that I feel can, and should, be done during the alpha release phase and completed with the beta release phase.

Is there anything holding back tagging an alpha release?

mbabker commented 7 years ago

Off the top of my head, I don't think so. I keep meaning to get folks together to start up a subteam in automated testing to take full lead on this and let you all manage the repo and release schedule for the tooling, hopefully with a little of the slowdown between 3.7 and starting up on 3.8 I can find time for that.

photodude commented 7 years ago

Would it be possible to get the alpha release tagged so public testing can go forward and let the subteam fall into place as the team is put together?

mbabker commented 7 years ago

https://github.com/joomla/coding-standards/releases/tag/2.0.0-alpha

We can throw more resources into this over the next couple of weeks.

mbabker commented 7 years ago

Also, https://packagist.org/packages/joomla/coding-standards

photodude commented 7 years ago

Thank you

elkuku commented 7 years ago

Thank you ;)

Am 26.04.2017 8:46 nachm. schrieb "Walt Sorensen" <notifications@github.com

:

Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/joomla/coding-standards/issues/143#issuecomment-297588315, or mute the thread https://github.com/notifications/unsubscribe-auth/AACEuidjAPmE8ONp2DoWJTHDi2tI13klks5rz_NmgaJpZM4LdeyI .

photodude commented 7 years ago

I have done a baseline test of the alpha release with the CMS using the example ruleset for the CMS. As expected I got no new errors reported.

Using the full ruleset I got the expected errors for things like failure to use camelCased naming.

you can see the configuration I used for .travis.yml and composer.json in my cms fork patch 9 https://github.com/photodude/joomla-cms/tree/patch-9

note: the composer.json file for the standard fails to correctly install the standard. Some minor adjustment will be needed to fix the path.