File tree Expand file tree Collapse file tree 6 files changed +2089
-1
lines changed Expand file tree Collapse file tree 6 files changed +2089
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ Desktop.ini
2525* .swp
2626* ~.nib
2727* ~
28+ * .travis /*
2829
2930# Ignore mergetool files
3031* .orig
@@ -34,7 +35,6 @@ build.properties
3435phing-latest.phar
3536
3637# Composer
37- composer.lock
3838composer.phar
3939vendor /*
4040tests /vendor /*
Original file line number Diff line number Diff line change 1+ language : php
2+ php :
3+ - 5.4
4+ before_script :
5+ - composer install
6+
7+ script :
8+ - vendor/bin/robo check:codestyle
Original file line number Diff line number Diff line change @@ -103,3 +103,13 @@ You should remove the WebDriver module and replace it with the JoomlaBrowser mod
103103 AcceptanceHelper :
104104 ...
105105` ` `
106+
107+ ## Tools
108+ Joomla Browser comes with a set of tools added via robo.li
109+
110+ ### Code Style Checker
111+ To check automatically the code style execute the following commands in your Terminal window at the root of the repository:
112+
113+ - ` $ composer install`
114+ - ` $ vendor/bin/robo`
115+ - ` $ vendor/bin/robo check:codestyle`
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * This is project's console commands configuration for Robo task runner.
5+ *
6+ * @see http://robo.li/
7+ */
8+ class RoboFile extends \Robo \Tasks
9+ {
10+ // Load tasks from composer, see composer.json
11+ use \joomla_projects \robo \loadTasks;
12+
13+ private $ extension = '' ;
14+
15+ /**
16+ * Set the Execute extension for Windows Operating System
17+ *
18+ * @return void
19+ */
20+ private function setExecExtension ()
21+ {
22+ if (strtoupper (substr (PHP_OS , 0 , 3 )) === 'WIN ' )
23+ {
24+ $ this ->extension = '.exe ' ;
25+ }
26+ }
27+
28+ /**
29+ * Check the code style of the project against a passed sniffers using PHP_CodeSniffer_CLI
30+ *
31+ * @param string $sniffersPath Path to the sniffers. If not provided Joomla Coding Standards will be used.
32+ */
33+ public function checkCodestyle ($ sniffersPath = null )
34+ {
35+ if (is_null ($ sniffersPath ))
36+ {
37+ $ this ->say ('Downloading Joomla Coding Standards Sniffers ' );
38+ $ this ->_exec ("git $ this ->extension clone -b master --single-branch --depth 1 https://github.com/joomla/coding-standards.git .travis/phpcs/Joomla " );
39+ $ sniffersPath = __DIR__ . '/.travis/phpcs/Joomla ' ;
40+ }
41+
42+ $ this ->taskCheckCodeStyle ()
43+ ->inspect (__DIR__ . '/src ' )
44+ ->dontStopOnFail (true )
45+ ->standard ($ sniffersPath )
46+ ->run ();
47+ }
48+ }
Original file line number Diff line number Diff line change 1818 "php" : " >=5.3.0" ,
1919 "codeception/codeception" : " 2.*"
2020 },
21+ "require-dev" : {
22+ "codegyre/robo" : " ^0.5.3" ,
23+ "joomla-projects/robo" : " dev-master"
24+ },
2125 "autoload" : {
2226 "psr-4" : {
2327 "Codeception\\ Module\\ " : " src"
You can’t perform that action at this time.
0 commit comments