# Makefile for PHP code analysis & testing, documentation and release generation
BIN = vendor/bin
-PHP_SOURCE = index.php application tests plugins
-all: static_analysis_summary check_permissions test
+all: check_permissions test
##
# Docker test adapter
# - http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php
# - http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php
##
-code_sniffer: code_sniffer_full
+PHPCS := $(BIN)/phpcs
-### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend...
-PHPCS_%:
- @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200 --standard=$*
+code_sniffer:
+ @$(PHPCS)
### - errors by Git author
code_sniffer_blame:
- @$(BIN)/phpcs $(PHP_SOURCE) --report-gitblame
+ @$(PHPCS) --report-gitblame
### - all errors/warnings
code_sniffer_full:
- @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200
+ @$(PHPCS) --report-full --report-width=200
### - errors grouped by kind
code_sniffer_source:
- @$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0
+ @$(PHPCS) --report-source || exit 0
##
# Checks source file & script permissions
--testsuite language-$(firstword $(subst _, ,$*))
all_tests: test locale_test_de_DE locale_test_en_US locale_test_fr_FR
- @$(BIN)/phpcov merge --html coverage coverage
+ @# --The current version is not compatible with PHP 7.2
+ @#$(BIN)/phpcov merge --html coverage coverage
@# --text doesn't work with phpunit 4.* (v5 requires PHP 5.6)
@#$(BIN)/phpcov merge --text coverage/txt coverage
+### download 3rd-party PHP libraries, including dev dependencies
+composer_dependencies_dev: clean
+ composer install --prefer-dist
+
##
# Custom release archive generation
#
### generate a release zip and include 3rd-party dependencies and translations
release_zip: composer_dependencies htmldoc translate build_frontend
git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).zip -9 HEAD
- mkdir -p $(ARCHIVE_PREFIX)/{doc,vendor}
+ mkdir -p $(ARCHIVE_PREFIX)/doc
+ mkdir -p $(ARCHIVE_PREFIX)/vendor
rsync -a doc/html/ $(ARCHIVE_PREFIX)doc/html/
zip -r $(ARCHIVE_VERSION).zip $(ARCHIVE_PREFIX)doc/
rsync -a vendor/ $(ARCHIVE_PREFIX)vendor/
@git shortlog -sne > AUTHORS
@rm .mailmap
-### generate Doxygen documentation
-doxygen: clean
- @rm -rf doxygen
- @doxygen Doxyfile
+### generate phpDocumentor documentation
+phpdoc: clean
+ @docker run --rm -v $(PWD):/data -u `id -u`:`id -g` phpdoc/phpdoc
### generate HTML documentation from Markdown pages with MkDocs
htmldoc:
python3 -m venv venv/
bash -c 'source venv/bin/activate; \
+ pip install wheel; \
pip install mkdocs; \
mkdocs build --clean'
find doc/html/ -type f -exec chmod a-x '{}' \;
eslint:
@yarn run eslint -c .dev/.eslintrc.js assets/vintage/js/
@yarn run eslint -c .dev/.eslintrc.js assets/default/js/
+ @yarn run eslint -c .dev/.eslintrc.js assets/common/js/
### Run CSSLint check against Shaarli's SCSS files
sasslint:
- @yarn run sass-lint -c .dev/.sasslintrc 'assets/default/scss/*.scss' -v -q
+ @yarn run stylelint --config .dev/.stylelintrc.js 'assets/default/scss/*.scss'