move some lint checks to Makefile

This commit is contained in:
korelstar 2019-08-28 21:45:15 +02:00
parent 0a07d44ebd
commit f48018374a
3 changed files with 10 additions and 7 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ js/
report report
clover.xml clover.xml
composer.lock composer.lock
appinfo/info.xsd
# just sane ignores # just sane ignores
.*.sw[po] .*.sw[po]

View File

@ -39,12 +39,6 @@ before_install:
- cd apps/$APP_NAME - cd apps/$APP_NAME
script: script:
# Check info.xml schema validity
- wget https://apps.nextcloud.com/schema/apps/info.xsd
- xmllint appinfo/info.xml --schema info.xsd --noout
- rm info.xsd
# Check PHP syntax errors
- find . -name \*.php -exec php -l "{}" \;
# Check app validity # Check app validity
- php ../../occ app:check-code notes - php ../../occ app:check-code notes
# Run PHP unit tests (skipped due to errors) # Run PHP unit tests (skipped due to errors)

View File

@ -91,9 +91,12 @@ test-coverage:
npm run test:coverage npm run test:coverage
# Linting # Linting
lint: lint-php lint-js lint-css lint: lint-php lint-js lint-css lint-nextcloud
lint-php: lint-php:
# Check PHP syntax errors
@! find lib/ -name "*.php" | xargs -I{} php -l '{}' | grep -v "No syntax errors detected"
# PHP CodeSniffer
vendor/bin/phpcs --standard=phpcs.xml --runtime-set ignore_warnings_on_exit 1 appinfo/ lib/ vendor/bin/phpcs --standard=phpcs.xml --runtime-set ignore_warnings_on_exit 1 appinfo/ lib/
lint-js: lint-js:
@ -102,6 +105,11 @@ lint-js:
lint-css: lint-css:
npm run stylelint npm run stylelint
lint-nextcloud:
# Check info.xml schema validity
wget https://apps.nextcloud.com/schema/apps/info.xsd -P appinfo/ -N --no-verbose || [ -f appinfo/info.xsd ]
xmllint appinfo/info.xml --schema appinfo/info.xsd --noout
# Fix lint # Fix lint
lint-fix: lint-php-fix lint-js-fix lint-css-fix lint-fix: lint-php-fix lint-js-fix lint-css-fix