From 1dc410425fd62af34ee58fe4fc5606eda9a46b45 Mon Sep 17 00:00:00 2001 From: theshka Date: Sun, 29 Nov 2015 14:55:55 -0600 Subject: [PATCH 1/6] Isolate build-related files from source * [Changed] rename `phpcs.xml` -> `.phpcs.xml` * [Changed] rename `build/` dir -> `_build/` * [Changed] update paths in `.gitignore` * [Changed] update paths in `.travis.yml` * [Changed] update paths in `.sh` scripts --- .gitignore | 4 ++-- phpcs.xml => .phpcs.xml | 4 ++-- .travis.yml | 4 ++-- {build => _build}/deploy-phpdoc-branch.sh | 4 ++-- {build => _build}/deploy-phpdoc-release.sh | 4 ++-- {build => _build}/deploy-phpdoc.sh | 0 {build => _build}/generate-phpdoc.sh | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) rename phpcs.xml => .phpcs.xml (87%) rename {build => _build}/deploy-phpdoc-branch.sh (87%) rename {build => _build}/deploy-phpdoc-release.sh (64%) rename {build => _build}/deploy-phpdoc.sh (100%) rename {build => _build}/generate-phpdoc.sh (93%) diff --git a/.gitignore b/.gitignore index 8e11af4..67a9029 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,8 @@ desktop.ini ._* # Travis -/build/phpdoc-*/ -/build/phpdoc-*.git/ +/_build/phpdoc-*/ +/_build/phpdoc-*.git/ # Composer /composer.lock diff --git a/phpcs.xml b/.phpcs.xml similarity index 87% rename from phpcs.xml rename to .phpcs.xml index 93b9ebb..72dd231 100644 --- a/phpcs.xml +++ b/.phpcs.xml @@ -6,9 +6,9 @@ - ^build/ + ^_build/ ^vendor/ *.min.js diff --git a/.travis.yml b/.travis.yml index aa0af02..90b27d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,10 +17,10 @@ install: - composer install before_script: - - export PATH="$TRAVIS_BUILD_DIR/build:$TRAVIS_BUILD_DIR/vendor/bin:$PATH" + - export PATH="$TRAVIS_BUILD_DIR/_build:$TRAVIS_BUILD_DIR/vendor/bin:$PATH" script: - - phpcs --standard=phpcs.xml "$TRAVIS_BUILD_DIR" + - phpcs --standard=.phpcs.xml "$TRAVIS_BUILD_DIR" after_success: - deploy-phpdoc-branch.sh diff --git a/build/deploy-phpdoc-branch.sh b/_build/deploy-phpdoc-branch.sh similarity index 87% rename from build/deploy-phpdoc-branch.sh rename to _build/deploy-phpdoc-branch.sh index f08063d..8ef9002 100755 --- a/build/deploy-phpdoc-branch.sh +++ b/_build/deploy-phpdoc-branch.sh @@ -18,11 +18,11 @@ fi PHPDOC_ID="${TRAVIS_BRANCH//\//_}" generate-phpdoc.sh \ - "$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \ + "$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID" \ "Pico 1.0 API Documentation ($TRAVIS_BRANCH branch)" [ $? -eq 0 ] || exit 1 deploy-phpdoc.sh \ - "$TRAVIS_REPO_SLUG" "heads/$TRAVIS_BRANCH @ $TRAVIS_COMMIT" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \ + "$TRAVIS_REPO_SLUG" "heads/$TRAVIS_BRANCH @ $TRAVIS_COMMIT" "$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID" \ "$TRAVIS_REPO_SLUG" "gh-pages" "phpDoc/$PHPDOC_ID" [ $? -eq 0 ] || exit 1 diff --git a/build/deploy-phpdoc-release.sh b/_build/deploy-phpdoc-release.sh similarity index 64% rename from build/deploy-phpdoc-release.sh rename to _build/deploy-phpdoc-release.sh index 721f3a4..cd66a31 100755 --- a/build/deploy-phpdoc-release.sh +++ b/_build/deploy-phpdoc-release.sh @@ -5,11 +5,11 @@ PHPDOC_ID="${TRAVIS_BRANCH//\//_}" generate-phpdoc.sh \ - "$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \ + "$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID" \ "Pico 1.0 API Documentation ($TRAVIS_TAG)" [ $? -eq 0 ] || exit 1 deploy-phpdoc.sh \ - "$TRAVIS_REPO_SLUG" "tags/$TRAVIS_TAG" "$TRAVIS_BUILD_DIR/build/phpdoc-$PHPDOC_ID" \ + "$TRAVIS_REPO_SLUG" "tags/$TRAVIS_TAG" "$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID" \ "$TRAVIS_REPO_SLUG" "gh-pages" "phpDoc/$PHPDOC_ID" [ $? -eq 0 ] || exit 1 diff --git a/build/deploy-phpdoc.sh b/_build/deploy-phpdoc.sh similarity index 100% rename from build/deploy-phpdoc.sh rename to _build/deploy-phpdoc.sh diff --git a/build/generate-phpdoc.sh b/_build/generate-phpdoc.sh similarity index 93% rename from build/generate-phpdoc.sh rename to _build/generate-phpdoc.sh index c2fe334..0c6fadf 100755 --- a/build/generate-phpdoc.sh +++ b/_build/generate-phpdoc.sh @@ -15,7 +15,7 @@ echo # generate phpdoc phpdoc -d "$PHPDOC_SOURCE_DIR" \ - -i "$PHPDOC_SOURCE_DIR/build/" \ + -i "$PHPDOC_SOURCE_DIR/_build/" \ -i "$PHPDOC_SOURCE_DIR/vendor/" \ -i "$PHPDOC_SOURCE_DIR/plugins/" -f "$PHPDOC_SOURCE_DIR/plugins/DummyPlugin.php" \ -t "$PHPDOC_TARGET_DIR" \ From 272a13f0f20b3bbe084b2bdc49b0380352a03aca Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 29 Nov 2015 22:54:18 +0100 Subject: [PATCH 2/6] Update CONTRIBUTING.md: Use Pico's .phpcs.xml instead of PSR2 standard for PHP_CodeSniffer --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b849472..ca6f0d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,11 +39,11 @@ Pico uses the [PSR-2 Coding Standard](http://www.php-fig.org/psr/psr-2/) as defi For historical reasons we don't use formal namespaces. Markdown files in the `content-sample` folder (the inline documentation) must follow a hard limit of 80 characters line length. -It is recommended to check your code using [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) using the `PSR2` standard using the following command: +It is recommended to check your code using [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) using Pico's `.phpcs.xml` standard. Use the following command: - $ ./bin/phpcs --standard=PSR2 [file(s)] + $ ./vendor/bin/phpcs --standard=.phpcs.xml [file]... -With this command you can specify a file or folder to limit which files it will check or omit that argument altogether, in which case the current directory is checked. +With this command you can specify a file or folder to limit which files it will check or omit that argument altogether, in which case the current working directory is checked. ### Keep documentation in sync From 4f9029629566fc29d4b86e15963f2c49faf5532e Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 29 Nov 2015 22:55:05 +0100 Subject: [PATCH 3/6] Update .phpcs.xml: Check $PWD by default --- .phpcs.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.phpcs.xml b/.phpcs.xml index 72dd231..77a35e5 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -5,6 +5,11 @@ but without the MissingNamespace sniff. + + . + From 1ea81d4b41a4bfd351239da39108b993ee3f04af Mon Sep 17 00:00:00 2001 From: theshka Date: Sun, 29 Nov 2015 15:55:25 -0600 Subject: [PATCH 4/6] add .phpdoc.xml and move ignore list --- .phpdoc.xml | 25 +++++++++++++++++++++++++ _build/generate-phpdoc.sh | 4 +--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .phpdoc.xml diff --git a/.phpdoc.xml b/.phpdoc.xml new file mode 100644 index 0000000..37619cb --- /dev/null +++ b/.phpdoc.xml @@ -0,0 +1,25 @@ + + + + lib/* + plugins/DummyPlugin.php + _build/* + config/* + content-sample/* + themes/* + plugins/* + vendor/* + .htaccess + *.git + .gitignore + *.xml + *.yml + *.json + *.lock + *.phar + *.md + *LICENSE + index.php + index.php.dist + + diff --git a/_build/generate-phpdoc.sh b/_build/generate-phpdoc.sh index 0c6fadf..8ff993e 100755 --- a/_build/generate-phpdoc.sh +++ b/_build/generate-phpdoc.sh @@ -15,9 +15,7 @@ echo # generate phpdoc phpdoc -d "$PHPDOC_SOURCE_DIR" \ - -i "$PHPDOC_SOURCE_DIR/_build/" \ - -i "$PHPDOC_SOURCE_DIR/vendor/" \ - -i "$PHPDOC_SOURCE_DIR/plugins/" -f "$PHPDOC_SOURCE_DIR/plugins/DummyPlugin.php" \ + -c "$PHPDOC_SOURCE_DIR/.phpdoc.xml" \ -t "$PHPDOC_TARGET_DIR" \ --title "$PHPDOC_TITLE" From 49e5e44b4a9819948aa9b47fb579007312c000e8 Mon Sep 17 00:00:00 2001 From: theshka Date: Sun, 29 Nov 2015 16:28:33 -0600 Subject: [PATCH 5/6] update .phpdoc.xml --- .phpdoc.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.phpdoc.xml b/.phpdoc.xml index 37619cb..ba0b1b9 100644 --- a/.phpdoc.xml +++ b/.phpdoc.xml @@ -9,17 +9,17 @@ themes/* plugins/* vendor/* + index.php + index.php.dist .htaccess - *.git .gitignore + *.git *.xml *.yml *.json *.lock *.phar *.md - *LICENSE - index.php - index.php.dist + LICENSE From 4be51a7bee682200d73a6e055a0954b74b78082a Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 30 Nov 2015 00:52:19 +0100 Subject: [PATCH 6/6] Refactor phpDoc generation --- .gitignore | 10 +++++---- .phpdoc.xml | 39 +++++++++++++++++++-------------- _build/deploy-phpdoc-branch.sh | 4 +++- _build/deploy-phpdoc-release.sh | 4 +++- _build/generate-phpdoc.sh | 13 ++++++----- 5 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 67a9029..7163361 100644 --- a/.gitignore +++ b/.gitignore @@ -10,15 +10,17 @@ desktop.ini .DS_Store ._* -# Travis -/_build/phpdoc-*/ -/_build/phpdoc-*.git/ - # Composer /composer.lock /composer.phar /vendor +# phpDocumentor +/_build/phpdoc/ +/_build/phpdoc.cache/ +/_build/phpdoc-*/ +/_build/phpdoc-*.git/ + # User config /config/config.php diff --git a/.phpdoc.xml b/.phpdoc.xml index 37619cb..c46b6da 100644 --- a/.phpdoc.xml +++ b/.phpdoc.xml @@ -1,25 +1,32 @@ + <![CDATA[Pico 1.0 API Documentation]]> + + _build/phpdoc.cache + + + _build/phpdoc + + +