From 8a7450e2260a9f939259d15ed35c1534270554c3 Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Mon, 15 Aug 2016 10:27:01 -0500 Subject: [PATCH 01/23] Adds PHP Code Sniffer target --- build.dist.xml | 4 ++-- composer.json | 1 + tasks/drupal_code_sniffer.xml | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 tasks/drupal_code_sniffer.xml diff --git a/build.dist.xml b/build.dist.xml index ef0865a5..f2fb8253 100644 --- a/build.dist.xml +++ b/build.dist.xml @@ -9,7 +9,7 @@ - + @@ -31,7 +31,7 @@ - Configure this target to run the tests. + diff --git a/composer.json b/composer.json index 82b27488..031aacd7 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "require": { "phing/phing": "^2.14", "continuousphp/phing-drush-task": "dev-master", + "drupal/coder": "^8.2", "pear/versioncontrol_git": "@dev" } } diff --git a/tasks/drupal_code_sniffer.xml b/tasks/drupal_code_sniffer.xml new file mode 100644 index 00000000..fd78f97b --- /dev/null +++ b/tasks/drupal_code_sniffer.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + From 2b6a7a26978b06ba6989a336f61fe2e24f6b6f77 Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Tue, 16 Aug 2016 10:01:11 -0500 Subject: [PATCH 02/23] Adds phpmd target --- .phpmd.dist.xml | 78 +++++++++++++++++++++++++++++++++++++++++++++++ build.dist.xml | 2 ++ composer.json | 1 + tasks/install.xml | 3 ++ tasks/phpmd.xml | 13 ++++++++ 5 files changed, 97 insertions(+) create mode 100644 .phpmd.dist.xml create mode 100644 tasks/phpmd.xml diff --git a/.phpmd.dist.xml b/.phpmd.dist.xml new file mode 100644 index 00000000..c1a66cfc --- /dev/null +++ b/.phpmd.dist.xml @@ -0,0 +1,78 @@ + + + + A PMD Ruleset for Drupal coding standards. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build.dist.xml b/build.dist.xml index f2fb8253..d9454481 100644 --- a/build.dist.xml +++ b/build.dist.xml @@ -10,6 +10,7 @@ + @@ -32,6 +33,7 @@ + diff --git a/composer.json b/composer.json index 031aacd7..2e36b571 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "phing/phing": "^2.14", "continuousphp/phing-drush-task": "dev-master", "drupal/coder": "^8.2", + "phpmd/phpmd" : "^2.4", "pear/versioncontrol_git": "@dev" } } diff --git a/tasks/install.xml b/tasks/install.xml index bea0d9e6..3de4407b 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -30,6 +30,9 @@ + + + diff --git a/tasks/phpmd.xml b/tasks/phpmd.xml new file mode 100644 index 00000000..9301e3ae --- /dev/null +++ b/tasks/phpmd.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + From bdb4040b32904284b21b795d24844818361eaa8c Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Tue, 16 Aug 2016 10:30:34 -0500 Subject: [PATCH 03/23] Adds phplint target --- build.dist.xml | 2 ++ tasks/phplint.xml | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 tasks/phplint.xml diff --git a/build.dist.xml b/build.dist.xml index d9454481..86a7fd97 100644 --- a/build.dist.xml +++ b/build.dist.xml @@ -11,6 +11,7 @@ + @@ -34,6 +35,7 @@ + diff --git a/tasks/phplint.xml b/tasks/phplint.xml new file mode 100644 index 00000000..83c5323d --- /dev/null +++ b/tasks/phplint.xml @@ -0,0 +1,10 @@ + + + + + + + + + + From 2c6e7b1e1c84defe10f10d934b35472b6891ea5e Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Tue, 16 Aug 2016 12:01:11 -0500 Subject: [PATCH 04/23] Adds phptodo target --- build.dist.xml | 2 ++ composer.json | 1 + php_todo_finder.yml | 7 +++++++ tasks/install.xml | 3 +++ tasks/phptodo.xml | 6 ++++++ 5 files changed, 19 insertions(+) create mode 100644 php_todo_finder.yml create mode 100644 tasks/phptodo.xml diff --git a/build.dist.xml b/build.dist.xml index 86a7fd97..5c343f22 100644 --- a/build.dist.xml +++ b/build.dist.xml @@ -12,6 +12,7 @@ + @@ -36,6 +37,7 @@ + diff --git a/composer.json b/composer.json index 2e36b571..a79d7b07 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "continuousphp/phing-drush-task": "dev-master", "drupal/coder": "^8.2", "phpmd/phpmd" : "^2.4", + "nilportugues/php_todo": "^1.0", "pear/versioncontrol_git": "@dev" } } diff --git a/php_todo_finder.yml b/php_todo_finder.yml new file mode 100644 index 00000000..d01617a9 --- /dev/null +++ b/php_todo_finder.yml @@ -0,0 +1,7 @@ +todo_finder: + total_allowed: 5 + expressions: + - @todo + - TODO + - refactor + - FIX ME diff --git a/tasks/install.xml b/tasks/install.xml index 3de4407b..c1e12164 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -33,6 +33,9 @@ + + + diff --git a/tasks/phptodo.xml b/tasks/phptodo.xml new file mode 100644 index 00000000..d59fd9d8 --- /dev/null +++ b/tasks/phptodo.xml @@ -0,0 +1,6 @@ +php_todo_finder.yml + + + + + From 487495167f920c42a284216f0a3135a7827bf6ec Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Wed, 17 Aug 2016 10:24:18 -0500 Subject: [PATCH 05/23] Fixes copy/pasta error --- tasks/phptodo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/phptodo.xml b/tasks/phptodo.xml index d59fd9d8..b78b6463 100644 --- a/tasks/phptodo.xml +++ b/tasks/phptodo.xml @@ -1,4 +1,4 @@ -php_todo_finder.yml + From 95a71c20d434eef9761e07929fa94da97f88b1b8 Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Fri, 19 Aug 2016 09:54:05 -0500 Subject: [PATCH 06/23] Adds ability to enable/disable drupal_code_sniffer --- tasks/drupal_code_sniffer.xml | 65 +++++++++++++++++++++++++++-------- tasks/install.xml | 1 + 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/tasks/drupal_code_sniffer.xml b/tasks/drupal_code_sniffer.xml index fd78f97b..f13b4384 100644 --- a/tasks/drupal_code_sniffer.xml +++ b/tasks/drupal_code_sniffer.xml @@ -3,21 +3,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + Drupal Code Sniffer is disabled + + diff --git a/tasks/install.xml b/tasks/install.xml index c1e12164..027e2dea 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -45,6 +45,7 @@ + From 86cd01bdb11e1cf554227ce6b39871461971bf59 Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Fri, 19 Aug 2016 10:07:10 -0500 Subject: [PATCH 07/23] Adds themes and profiles to be tested with drupal_code_sniffer --- tasks/drupal_code_sniffer.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tasks/drupal_code_sniffer.xml b/tasks/drupal_code_sniffer.xml index f13b4384..2775bc9e 100644 --- a/tasks/drupal_code_sniffer.xml +++ b/tasks/drupal_code_sniffer.xml @@ -42,6 +42,7 @@ haltonerror="true" verbosity="1" > + @@ -50,6 +51,24 @@ + + + + + + + + + + + + + + + + + + From 4cdba4e9eb2c03bb789d21fdb4f84252abe454bc Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Fri, 19 Aug 2016 11:14:12 -0500 Subject: [PATCH 08/23] Adds ability to enable/disable phpmd --- tasks/install.xml | 1 + tasks/phpmd.xml | 51 ++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/tasks/install.xml b/tasks/install.xml index 027e2dea..4ec9de7e 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -46,6 +46,7 @@ + diff --git a/tasks/phpmd.xml b/tasks/phpmd.xml index 9301e3ae..dab5d0e9 100644 --- a/tasks/phpmd.xml +++ b/tasks/phpmd.xml @@ -1,13 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + PHPMD is disabled. + + From cbb5ec40aaf7956fb50136e070b2db8562e1ceaa Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Fri, 19 Aug 2016 14:34:10 -0500 Subject: [PATCH 09/23] Adds ability to enable/disable phptodo --- tasks/install.xml | 1 + tasks/phptodo.xml | 55 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/tasks/install.xml b/tasks/install.xml index 4ec9de7e..036a7fe8 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -47,6 +47,7 @@ + diff --git a/tasks/phptodo.xml b/tasks/phptodo.xml index b78b6463..86669418 100644 --- a/tasks/phptodo.xml +++ b/tasks/phptodo.xml @@ -1,6 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + Checking modules + + Checking profiles + + Checking themes + + + + PHP Todo is disabled. + + From 4f55dd0f521b5690ce04e0c65548b2244f5f448d Mon Sep 17 00:00:00 2001 From: Mathew Peterson Date: Fri, 19 Aug 2016 14:39:45 -0500 Subject: [PATCH 10/23] Adds profiles and themes to phplint --- tasks/phplint.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tasks/phplint.xml b/tasks/phplint.xml index 83c5323d..d6cf1c21 100644 --- a/tasks/phplint.xml +++ b/tasks/phplint.xml @@ -1,10 +1,23 @@ + + + - + + + + + + + + + + + PHP Lint was successful From c420506e82d9e66174a77249ee320ebd6c6049a0 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 19:47:16 -0600 Subject: [PATCH 11/23] Remove unnecessary property isset checking. --- tasks/drupal_code_sniffer.xml | 7 +------ tasks/phpmd.xml | 7 +------ tasks/phptodo.xml | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/tasks/drupal_code_sniffer.xml b/tasks/drupal_code_sniffer.xml index 2775bc9e..68caf6af 100644 --- a/tasks/drupal_code_sniffer.xml +++ b/tasks/drupal_code_sniffer.xml @@ -4,12 +4,7 @@ - - - - - - + diff --git a/tasks/phpmd.xml b/tasks/phpmd.xml index dab5d0e9..8c50a48d 100644 --- a/tasks/phpmd.xml +++ b/tasks/phpmd.xml @@ -2,12 +2,7 @@ - - - - - - + diff --git a/tasks/phptodo.xml b/tasks/phptodo.xml index 86669418..6abfb407 100644 --- a/tasks/phptodo.xml +++ b/tasks/phptodo.xml @@ -2,12 +2,7 @@ - - - - - - + From 2d3e5f5d650aea125694782f93068bc00d432d51 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 19:52:52 -0600 Subject: [PATCH 12/23] Remove wrapper if statements. --- tasks/drupal_code_sniffer.xml | 101 ++++++++++++---------------------- tasks/install.xml | 3 - tasks/phplint.xml | 2 + tasks/phpmd.xml | 46 +++------------- tasks/phptodo.xml | 63 ++++++--------------- 5 files changed, 63 insertions(+), 152 deletions(-) diff --git a/tasks/drupal_code_sniffer.xml b/tasks/drupal_code_sniffer.xml index 68caf6af..d5a967e0 100644 --- a/tasks/drupal_code_sniffer.xml +++ b/tasks/drupal_code_sniffer.xml @@ -1,74 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Drupal Code Sniffer is disabled - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tasks/install.xml b/tasks/install.xml index 036a7fe8..c1e12164 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -45,9 +45,6 @@ - - - diff --git a/tasks/phplint.xml b/tasks/phplint.xml index d6cf1c21..1bd68be1 100644 --- a/tasks/phplint.xml +++ b/tasks/phplint.xml @@ -20,4 +20,6 @@ PHP Lint was successful + + diff --git a/tasks/phpmd.xml b/tasks/phpmd.xml index 8c50a48d..a94fdd13 100644 --- a/tasks/phpmd.xml +++ b/tasks/phpmd.xml @@ -1,45 +1,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PHPMD is disabled. - - + + + + + + + + + diff --git a/tasks/phptodo.xml b/tasks/phptodo.xml index 6abfb407..99c2536a 100644 --- a/tasks/phptodo.xml +++ b/tasks/phptodo.xml @@ -1,54 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Checking modules - - Checking profiles - - Checking themes - - - - PHP Todo is disabled. - - + Checking modules + + Checking profiles + + Checking themes + + + From 4bd7f53e28e6557c8f193a981c40ccd64c8e2e16 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 19:55:30 -0600 Subject: [PATCH 13/23] Fix file name in script. --- tasks/install.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/install.xml b/tasks/install.xml index c1e12164..534eaa06 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -33,8 +33,8 @@ - - + + From c1aec8aaa1f5a6ac9bc4b13ea114b8646b7c0395 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 20:12:48 -0600 Subject: [PATCH 14/23] Put the drupal code sniffer property back. --- tasks/drupal_code_sniffer.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/drupal_code_sniffer.xml b/tasks/drupal_code_sniffer.xml index d5a967e0..a16afaac 100644 --- a/tasks/drupal_code_sniffer.xml +++ b/tasks/drupal_code_sniffer.xml @@ -1,6 +1,8 @@ + + From 3e8a38c865bc568471583408502da43bb0f4f11f Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 21:02:38 -0600 Subject: [PATCH 15/23] Don't hide the phpmd.xml file. --- .phpmd.dist.xml => phpmd.dist.xml | 0 tasks/install.xml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .phpmd.dist.xml => phpmd.dist.xml (100%) diff --git a/.phpmd.dist.xml b/phpmd.dist.xml similarity index 100% rename from .phpmd.dist.xml rename to phpmd.dist.xml diff --git a/tasks/install.xml b/tasks/install.xml index 534eaa06..5dddc64f 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -30,8 +30,8 @@ - - + + From ba96cc3752b8430e72f40701015eab58e7e50005 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 21:02:57 -0600 Subject: [PATCH 16/23] Don't stop on codesniffer failures. --- tasks/drupal_code_sniffer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/drupal_code_sniffer.xml b/tasks/drupal_code_sniffer.xml index a16afaac..c053ae94 100644 --- a/tasks/drupal_code_sniffer.xml +++ b/tasks/drupal_code_sniffer.xml @@ -8,7 +8,7 @@ From 3eb5e0bf4a4aceae7162e6414039837da35758e0 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 21:13:39 -0600 Subject: [PATCH 17/23] Move the code review tasks into a subdirectory. --- build.dist.xml | 8 ++++---- tasks/{ => code_review}/drupal_code_sniffer.xml | 0 tasks/{ => code_review}/phplint.xml | 0 tasks/{ => code_review}/phpmd.xml | 0 tasks/{ => code_review}/phptodo.xml | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename tasks/{ => code_review}/drupal_code_sniffer.xml (100%) rename tasks/{ => code_review}/phplint.xml (100%) rename tasks/{ => code_review}/phpmd.xml (100%) rename tasks/{ => code_review}/phptodo.xml (100%) diff --git a/build.dist.xml b/build.dist.xml index 5c343f22..eb357a41 100644 --- a/build.dist.xml +++ b/build.dist.xml @@ -9,10 +9,10 @@ - - - - + + + + diff --git a/tasks/drupal_code_sniffer.xml b/tasks/code_review/drupal_code_sniffer.xml similarity index 100% rename from tasks/drupal_code_sniffer.xml rename to tasks/code_review/drupal_code_sniffer.xml diff --git a/tasks/phplint.xml b/tasks/code_review/phplint.xml similarity index 100% rename from tasks/phplint.xml rename to tasks/code_review/phplint.xml diff --git a/tasks/phpmd.xml b/tasks/code_review/phpmd.xml similarity index 100% rename from tasks/phpmd.xml rename to tasks/code_review/phpmd.xml diff --git a/tasks/phptodo.xml b/tasks/code_review/phptodo.xml similarity index 100% rename from tasks/phptodo.xml rename to tasks/code_review/phptodo.xml From 3b32767ea3275b60da39ac536418563d29d96445 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 21:36:09 -0600 Subject: [PATCH 18/23] Don't copy the phpmd and php_todo config to projects by default. --- php_todo_finder.yml => conf/php_todo_finder.yml | 0 phpmd.dist.xml => conf/phpmd.xml | 0 tasks/code_review/phpmd.xml | 3 ++- tasks/code_review/phptodo.xml | 7 ++++--- tasks/install.xml | 6 ------ 5 files changed, 6 insertions(+), 10 deletions(-) rename php_todo_finder.yml => conf/php_todo_finder.yml (100%) rename phpmd.dist.xml => conf/phpmd.xml (100%) diff --git a/php_todo_finder.yml b/conf/php_todo_finder.yml similarity index 100% rename from php_todo_finder.yml rename to conf/php_todo_finder.yml diff --git a/phpmd.dist.xml b/conf/phpmd.xml similarity index 100% rename from phpmd.dist.xml rename to conf/phpmd.xml diff --git a/tasks/code_review/phpmd.xml b/tasks/code_review/phpmd.xml index a94fdd13..4c2ad221 100644 --- a/tasks/code_review/phpmd.xml +++ b/tasks/code_review/phpmd.xml @@ -1,10 +1,11 @@ + - + diff --git a/tasks/code_review/phptodo.xml b/tasks/code_review/phptodo.xml index 99c2536a..5d12d4f2 100644 --- a/tasks/code_review/phptodo.xml +++ b/tasks/code_review/phptodo.xml @@ -1,22 +1,23 @@ + Checking modules Checking profiles Checking themes diff --git a/tasks/install.xml b/tasks/install.xml index 5dddc64f..bea0d9e6 100644 --- a/tasks/install.xml +++ b/tasks/install.xml @@ -30,12 +30,6 @@ - - - - - - From 1ac262d5791ee5c6059b0a14df2c1b3000cb8d45 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 11 Nov 2016 21:46:17 -0600 Subject: [PATCH 19/23] Don't add the code review tools to the default 'test' target, instead provide them as a usable example. --- build.dist.xml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build.dist.xml b/build.dist.xml index eb357a41..177528a6 100644 --- a/build.dist.xml +++ b/build.dist.xml @@ -9,10 +9,7 @@ - - - - + @@ -34,10 +31,18 @@ - - - - + Configure this target to run the tests. + + + + + + + + + + + From 54ea88d53200d5c93d786ee5719efa69bf72199a Mon Sep 17 00:00:00 2001 From: Bec White Date: Mon, 21 Nov 2016 11:49:36 -0600 Subject: [PATCH 20/23] Add description for the code-review task. --- build.dist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.dist.xml b/build.dist.xml index 177528a6..bb4f9c73 100644 --- a/build.dist.xml +++ b/build.dist.xml @@ -37,7 +37,7 @@ - + From 66a70226c031c00a3a9b57aa8a9d1cff617df814 Mon Sep 17 00:00:00 2001 From: Bec White Date: Mon, 21 Nov 2016 11:50:07 -0600 Subject: [PATCH 21/23] Add the code-review to the default circle config. --- circle.dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.dist.yml b/circle.dist.yml index 0d47defc..6c2044fb 100644 --- a/circle.dist.yml +++ b/circle.dist.yml @@ -36,4 +36,4 @@ test: - vendor/bin/phing build install migrate override: - - vendor/bin/phing test + - vendor/bin/phing code-review test From 8a6ee5253c5cc9236011d6d1f9d17fccd52093a2 Mon Sep 17 00:00:00 2001 From: Bec White Date: Mon, 21 Nov 2016 12:17:41 -0600 Subject: [PATCH 22/23] Rename property. --- tasks/code_review/drupal_code_sniffer.xml | 4 ++-- tasks/code_review/phplint.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/code_review/drupal_code_sniffer.xml b/tasks/code_review/drupal_code_sniffer.xml index c053ae94..b2736ead 100644 --- a/tasks/code_review/drupal_code_sniffer.xml +++ b/tasks/code_review/drupal_code_sniffer.xml @@ -1,13 +1,13 @@ - + diff --git a/tasks/code_review/phplint.xml b/tasks/code_review/phplint.xml index 1bd68be1..389380bf 100644 --- a/tasks/code_review/phplint.xml +++ b/tasks/code_review/phplint.xml @@ -4,7 +4,7 @@ - + From 2d4af488747adb2d92dd144485650606b05f7927 Mon Sep 17 00:00:00 2001 From: Bec White Date: Mon, 21 Nov 2016 12:17:54 -0600 Subject: [PATCH 23/23] Add docs on code reviews. --- docs/code_review.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/code_review.md diff --git a/docs/code_review.md b/docs/code_review.md new file mode 100644 index 00000000..ff8a8872 --- /dev/null +++ b/docs/code_review.md @@ -0,0 +1,40 @@ +# Code Review in the-build + +From your project where you have installed the-build, run `vendor/bin/phing code-review` to run the default set of code reviews. This target is provided in the default `build.xml` created for your project during install. + +This will review your code with: + +* Drupal Codesniffer +* PHPmd +* PHP Lint +* PHPtodo + +Generally, you should configure your `build.xml` to run code reviews as part of your `test` target so that developers run the reviews by default. + +### PHP Lint + +PHP Lint uses the PHP interpreter directly to check for syntax errors. There is no configuration for this review. + +### [PHPMD](https://phpmd.org/) + +A more complicated and more general PHP code review than the Drupal Codesniffer standard. The default config for this review can be found within the-build at `conf/phpmd.xml`. To customize this config, copy that file to your project's `conf/` directory and add the build property: + +``` +phpmd.rulesets=conf/phpmd.xml +``` + +### Drupal Codesniffer + +Runs codesniffer using the standard provided by Drupal's [Coder](https://www.drupal.org/project/coder) module. Generally, you should not change the configuration for this review, but if do need to you can provide a different standard: + +``` +drupal_code_sniffer.standard=vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml +``` + +### [PHP To-do Finder](https://github.com/nilportugues/php-todo-finder) + +Sets a threshold for the number of "to do" comments allowable in a codebase. The default config for this review can be found within the-build at `conf/php_todo_finder.yml`. To customize this config, copy that file to your project's `conf/` directory and add the build property: + +``` +phptodo.config=conf/php_todo_finder.yml +```