From ba2cff154954c29cf8e8d60848c053d164bf7832 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Fri, 23 Feb 2018 00:37:03 +0100 Subject: Doxygen: ignore data/, simplify Make target Signed-off-by: VirtualTam --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d659d908..5e3ae26d 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ authors: ### generate Doxygen documentation doxygen: clean @rm -rf doxygen - @( cat Doxyfile ; echo "PROJECT_NUMBER=`git describe`" ) | doxygen - + @doxygen Doxyfile ### generate HTML documentation from Markdown pages with MkDocs htmldoc: @@ -206,4 +206,4 @@ htmldoc: ### Generate Shaarli's translation compiled file (.mo) translate: - @find inc/languages/ -name shaarli.po -execdir msgfmt shaarli.po -o shaarli.mo \; \ No newline at end of file + @find inc/languages/ -name shaarli.po -execdir msgfmt shaarli.po -o shaarli.mo \; -- cgit v1.2.3 From 47978e8772d9ac355c76f6ccd6fc59394bc7c301 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 24 Feb 2018 18:37:57 +0100 Subject: Webpack / Configure webpack, ESLint, Travis, Makefile, npm/yarn and git --- Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5e3ae26d..d1216569 100644 --- a/Makefile +++ b/Makefile @@ -157,15 +157,23 @@ composer_dependencies: clean composer install --no-dev --prefer-dist find vendor/ -name ".git" -type d -exec rm -rf {} + +### download 3rd-party frontend libraries +frontend_dependencies: + yarn install + +### Build frontend dependencies +build_frontend: frontend_dependencies + yarn run build + ### generate a release tarball and include 3rd-party dependencies and translations -release_tar: composer_dependencies htmldoc translate +release_tar: composer_dependencies htmldoc translate build_frontend git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).tar HEAD tar rvf $(ARCHIVE_VERSION).tar --transform "s|^vendor|$(ARCHIVE_PREFIX)vendor|" vendor/ tar rvf $(ARCHIVE_VERSION).tar --transform "s|^doc/html|$(ARCHIVE_PREFIX)doc/html|" doc/html/ gzip $(ARCHIVE_VERSION).tar ### generate a release zip and include 3rd-party dependencies and translations -release_zip: composer_dependencies htmldoc translate +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} rsync -a doc/html/ $(ARCHIVE_PREFIX)doc/html/ @@ -207,3 +215,8 @@ htmldoc: ### Generate Shaarli's translation compiled file (.mo) translate: @find inc/languages/ -name shaarli.po -execdir msgfmt shaarli.po -o shaarli.mo \; + +### Run ESLint check against Shaarli's JS files +eslint: + @yarn run eslint assets/vintage/js/ + @yarn run eslint assets/default/js/ -- cgit v1.2.3 From 03b483aa45ca994c0d75010e2008a8f0bfcf7ed3 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 10 May 2018 13:29:47 +0200 Subject: Add SASSLint makefile target, and run it in CI Also move ESLint and SASSLint config files to a dedicated .dev folder --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d1216569..4adbdd68 100644 --- a/Makefile +++ b/Makefile @@ -218,5 +218,9 @@ translate: ### Run ESLint check against Shaarli's JS files eslint: - @yarn run eslint assets/vintage/js/ - @yarn run eslint assets/default/js/ + @yarn run eslint -c .dev/.eslintrc.js assets/vintage/js/ + @yarn run eslint -c .dev/.eslintrc.js assets/default/js/ + +### Run CSSLint check against Shaarli's SCSS files +sasslint: + @yarn run sass-lint -c .dev/.sasslintrc 'assets/default/scss/*.scss' -v -q -- cgit v1.2.3 From fd2e8fad79161a77423728abbc492fe8a68287fc Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Tue, 26 Jun 2018 22:20:29 +0200 Subject: Let MkDocs clean previously generated HTML pages Signed-off-by: VirtualTam --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4adbdd68..b0cdadf0 100644 --- a/Makefile +++ b/Makefile @@ -207,7 +207,7 @@ htmldoc: python3 -m venv venv/ bash -c 'source venv/bin/activate; \ pip install mkdocs; \ - mkdocs build' + mkdocs build --clean' find doc/html/ -type f -exec chmod a-x '{}' \; rm -r venv -- cgit v1.2.3 From a136a427ae82648a0fac533583f68806f931ae8d Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 28 Jul 2018 19:52:47 +0200 Subject: Include assets in the release_archive Makefile target --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b0cdadf0..56cf09b2 100644 --- a/Makefile +++ b/Makefile @@ -170,6 +170,7 @@ release_tar: composer_dependencies htmldoc translate build_frontend git archive --prefix=$(ARCHIVE_PREFIX) -o $(ARCHIVE_VERSION).tar HEAD tar rvf $(ARCHIVE_VERSION).tar --transform "s|^vendor|$(ARCHIVE_PREFIX)vendor|" vendor/ tar rvf $(ARCHIVE_VERSION).tar --transform "s|^doc/html|$(ARCHIVE_PREFIX)doc/html|" doc/html/ + tar rvf $(ARCHIVE_VERSION).tar --transform "s|^tpl|$(ARCHIVE_PREFIX)tpl|" tpl/ gzip $(ARCHIVE_VERSION).tar ### generate a release zip and include 3rd-party dependencies and translations @@ -180,6 +181,8 @@ release_zip: composer_dependencies htmldoc translate build_frontend zip -r $(ARCHIVE_VERSION).zip $(ARCHIVE_PREFIX)doc/ rsync -a vendor/ $(ARCHIVE_PREFIX)vendor/ zip -r $(ARCHIVE_VERSION).zip $(ARCHIVE_PREFIX)vendor/ + rsync -a tpl/ $(ARCHIVE_PREFIX)tpl/ + zip -r $(ARCHIVE_VERSION).zip $(ARCHIVE_PREFIX)tpl/ rm -rf $(ARCHIVE_PREFIX) ## -- cgit v1.2.3 From 37c9c6b4e62ba25f889ebb6486fe5c442acc9095 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Fri, 12 Oct 2018 23:47:59 +0200 Subject: lint: remove unused tools Signed-off-by: VirtualTam --- Makefile | 56 -------------------------------------------------------- 1 file changed, 56 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 56cf09b2..28740690 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ BIN = vendor/bin PHP_SOURCE = index.php application tests plugins -PHP_COMMA_SOURCE = index.php,application,tests,plugins all: static_analysis_summary check_permissions test @@ -17,14 +16,6 @@ docker_%: rsync -az /shaarli/ ~/shaarli/ cd ~/shaarli && make $* -## -# Concise status of the project -# These targets are non-blocking: || exit 0 -## - -static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary - @echo - ## # PHP_CodeSniffer # Detects PHP syntax errors @@ -32,7 +23,6 @@ static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary # - 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 ### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend... @@ -51,52 +41,6 @@ code_sniffer_full: code_sniffer_source: @$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0 -## -# PHP Copy/Paste Detector -# Detects code redundancy -# Documentation: https://github.com/sebastianbergmann/phpcpd -## - -copy_paste: - @echo "-----------------------" - @echo "PHP COPY/PASTE DETECTOR" - @echo "-----------------------" - @$(BIN)/phpcpd $(PHP_SOURCE) || exit 0 - @echo - -## -# PHP Mess Detector -# Detects PHP syntax errors, sorted by category -# Rules documentation: http://phpmd.org/rules/index.html -## -MESS_DETECTOR_RULES = cleancode,codesize,controversial,design,naming,unusedcode - -mess_title: - @echo "-----------------" - @echo "PHP MESS DETECTOR" - @echo "-----------------" - -### - all warnings -mess_detector: mess_title - @$(BIN)/phpmd $(PHP_COMMA_SOURCE) text $(MESS_DETECTOR_RULES) | sed 's_.*\/__' - -### - all warnings + HTML output contains links to PHPMD's documentation -mess_detector_html: - @$(BIN)/phpmd $(PHP_COMMA_SOURCE) html $(MESS_DETECTOR_RULES) \ - --reportfile phpmd.html || exit 0 - -### - warnings grouped by message, sorted by descending frequency order -mess_detector_grouped: mess_title - @$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) \ - | cut -f 2 | sort | uniq -c | sort -nr - -### - summary: number of warnings by rule set -mess_detector_summary: mess_title - @for rule in $$(echo $(MESS_DETECTOR_RULES) | tr ',' ' '); do \ - warnings=$$($(BIN)/phpmd $(PHP_COMMA_SOURCE) text $$rule | wc -l); \ - printf "$$warnings\t$$rule\n"; \ - done; - ## # Checks source file & script permissions ## -- cgit v1.2.3 From 04ec8fedd91642d4c0fc96258868086b8a51c899 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 13 Oct 2018 00:05:04 +0200 Subject: lint: setup PHPCS for PSR-1 and PSR-2 Relates to https://github.com/shaarli/Shaarli/issues/95 See: - https://github.com/squizlabs/PHP_CodeSniffer - https://github.com/squizlabs/PHP_CodeSniffer/blob/master/phpcs.xml.dist - https://www.php-fig.org/psr/psr-1/ - https://www.php-fig.org/psr/psr-2/ Signed-off-by: VirtualTam --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 28740690..b758d1fd 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ # 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 @@ -23,23 +22,26 @@ docker_%: # - 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 + +code_sniffer: + @$(PHPCS) ### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend... PHPCS_%: - @$(BIN)/phpcs $(PHP_SOURCE) --report-full --report-width=200 --standard=$* + @$(PHPCS) --report-full --report-width=200 --standard=$* ### - 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 -- cgit v1.2.3