Download & Extend

Coder Review Drupal 8.x Battleplan

Project:Coder
Version:7.x-1.x-dev
Component:Coder Review
Category:task
Priority:major
Assigned:douggreen
Status:active

Issue Summary

I am resuming responsibility for coder review, the original coder module, as of DrupalCon Munich. I originally wrote coder for Drupal 4.7 and was responsible for it up through Drupal 6.x. Stella started working with me sometime during the 6.x days and took the reigns for Drupal 7.x through today. Many thanks to her many years of hard work keeping the coder project going strong. I suspect she will still be a contributor and a committer, but we are attempting to pass the torch back to me.

Coder was written a long time ago, and while new rules have been added, the coder engine has not been updated in a long time. Before creating an 8.x branch, my plan is to start a 7.x-2.x branch, modernize coder, then start 8.x-1.x-dev. This will take several months.

For those trying to use coder to upgrade to 8.x, these rules will go first into the 7.x-2.x-dev branch, but beware that this is going to be unstable for the foreseeable future. I will make an effort to also put them in the 7.x-1.x-dev, mainly so that I can compare output between the two branches as part of a test case to make sure that the modernized coders works the same as the original.

The 6.x branch will no longer be updated. For anyone trying to use coder, you can install it on a 7.x branch and run it on 6.x code just fine.

So now, here is the @todo list:

  1. Code cleanup, I review a lot of other peoples code, and frankly, things I wrote 5 years ago are no longer up to my own code review. - douggreen
  2. Cleanup rules warning definitions to not require callbacks, which means the definition should include the t() arguments. - douggreen
  3. Make drush commands run without needing a Drupal installation. - douggreen
  4. Modernize drush commands to use proper options and arguments. - douggreen
  5. Cleanup use of FAPI to properly use form_state, there's some ugly magic going on to make things work. - stella
  6. Related to the FAPI cleanup, coder should use batch API. - stella
  7. Improve the UI to use more jQuery. - stella
  8. Allow some things to be fixed using an extended rule (and preg_replace). Look closer at coder_upgrade and merging it. - douggreen
  9. Write a Drupal Code sniffer rule. Talk again with klausi, douggren, and stella a week or two after DrupalCon Munich.
  10. Cleanup the issue queue, there are just too many open issues. - douggreen ... this isn't "done", but I feel we have enough of a handle on it now
  11. Start the 8.x upgrade review.
  12. Review the rule types, try to add a new "parsetree" or "token" rule, maybe unnecessary with Drupal Code Sniffer review.
  13. Extend the "ignore lines" functionality to work off inline comments, perhaps. Existing functionality might need a review.
  14. Document hook_reviews() in coder_review.api.php. - douggreen, ltoomre
  15. Make a patch for D8 core to make it coding standards compliant, this can be done either from a 7.x-2.x or an 8.x release, See #1518116: [meta] Make Core pass Coder Review

A more official @todo list can be found in the issue queue with this search, open issues assigned to me for 7.x-2.x

I will maintain this list as things get completed, with potentially new items, and with follow-up ticket numbers. It's probably not everything on this list will get done before we start the 8.x branch.

Comments

#1

Thank you for taking this on, Doug!

Freezing Coder for D6 is only reasonable. Between D7 and D8, please keep in mind that the version that ends up on qa.d.o will define the gold standard.

#2

Great job @douggreen. Big task.

After this does it make sense to take on Coder Upgrade? I proposed an idea a while ago to look at more tightly coupling this into drupal.org to improve the upgrade times - #1623462: Tie in drupal.org with Coder Upgrade after D8 released

#3

@douggreen - I have created a patch so that it can be used for task #15. The 7.x-2.x doesn't work in D8 as {system} table has been removed - [#1813642]

#4

@amitgoyal FWIW, until we get the D8 version working, you can always run coder on 8.x files from the 7.x release. The easiest way to do this is to install coder as a drush plugin, and then you can just run 'drush coder-review' on any file directory tree.

#5

@douggreen - Earlier I was using 7.x release to do code review of 8.x files. I was doing it by putting 7.x release of coder in D8 and then changing the .info files. But as I mentioned "The {system} table has been removed", [#1813642], in D8 so I needed a patch, #1816302: Code Review 7.x-1.2 to 8.x-1.x Patch, to do the review of 8.x files.

It's working fine for me and hoped it might help others so I provided the patch as few asked me that how I am doing the code-review in D8.

#6

I created #1888912: Create 8.x upgrade rules as a dedicated issue to discuss #11. If anyone has any input into how that could get started, that would be awesome!

EDIT: Hm. It occurs to me that this issue is only about the Review piece, not the Upgrade piece, so this is probably OT. Sorry about that. Still, if anyone has any insight it would be appreciated. :)

nobody click here