Skip to content
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

(NFC) Update various files to pass future civicrm/coder ruleset #13979

Merged
merged 8 commits into from
Apr 6, 2019

Conversation

totten
Copy link
Member

@totten totten commented Apr 5, 2019

Overview

There are pending updates to the civicrm/coder ruleset which would add a large batch of style issues. This pays down a little of that debt in advance.

NOTE: This builds on #13978, which should be probably merged first.

Method

  • Checkout latest merged branch of civicrm/coder (8.x-2.x-civi; aka 503b3f4d91b4f37bf6004c5e15e3beb37fed6c6b)
  • Run a command to autoclean a batch of PHP files. This variant treats the file list as pages with 100 items each, and it processes the second page.
    • PG=2 SIZE=100 ; find Civi/ CRM/ api/ bin/ extern/ tests/ -name '*.php' | grep -v /examples/ | grep -v /DAO/ | sort | head -n $(( $PG * $SIZE )) | tail -n $SIZE | xargs phpcbf-civi
  • Go through the diff. For anything that looks wonky, open in an editor and find a better solution.

Note: The automated checker makes good points about awkward indentation, but the automated cleanup often makes it worse. So that's why I have to open it up.

Note: So far, I've observed that ~33% of scanned files actually raise issues. Processing a batch of 100 files per above takes me about 20-30min.

totten added 8 commits April 5, 2019 13:11
Method:

* Checkout latest merged branch of civicrm/coder (`8.x-2.x-civi`)
* Run this command to autoclean a batch of 100 files
 `PG=1 SIZE=100 ; find Civi/ CRM/ api/ bin/ extern/ tests/ -name '*.php' | grep -v /examples/ | grep -v /DAO/ | sort | head -n $(( $PG  * $SIZE )) | tail -n $SIZE | xargs phpcbf-civi`
* Go through the diff. For anything that looks wonky, open in an editor and find a better solution

Note: The automated checker makes good points about awkward indentation, but the automated cleanup often makes it
worse.  So that's why I have to open it up.
Method:

* Checkout latest merged branch of civicrm/coder (`8.x-2.x-civi`)
* Run this command to autoclean a batch of 100 files
  `PG=2 SIZE=100 ; find Civi/ CRM/ api/ bin/ extern/ tests/ -name '*.php' | grep -v /examples/ | grep -v /DAO/ | sort | head -n $(( $PG  * $SIZE )) | tail -n $SIZE | xargs phpcbf-civi`
* Go through the diff. For anything that looks wonky, open in an editor and find a better solution.

Note: The automated checker makes good points about awkward indentation, but the automated cleanup often makes it
worse.  So that's why I have to open it up.
@civibot
Copy link

civibot bot commented Apr 5, 2019

(Standard links)

@civibot civibot bot added the master label Apr 5, 2019
@@ -30,7 +30,6 @@
* @copyright CiviCRM LLC (c) 2004-2019
*/

use Civi\ActionSchedule\RecipientBuilder;
Copy link
Contributor

Choose a reason for hiding this comment

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

@totten this is an interesting one

Copy link
Member Author

@totten totten Apr 5, 2019

Choose a reason for hiding this comment

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

Agree. I opened that file to double-check references, and it seemed OK without the use statement. Also, CRM_Activity_ActionMappingTest, has coverage of this file. (There was an @see, but that worked with or without the use.)

@seamuslee001
Copy link
Contributor

This looks good to me merging

@seamuslee001 seamuslee001 merged commit b9e9e8d into civicrm:master Apr 6, 2019
@totten totten deleted the master-phpcbf-2 branch April 6, 2019 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants