diff --git a/.travis.yml b/.travis.yml index 999cd5d464..1be144dd28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,9 @@ script: - python manage.py collectstatic > /dev/null - py.test --cov - python manage.py makemigrations --dry-run --check --noinput - - ./node_modules/.bin/polylint -F + - isort --diff -rc -c meinberlin tests + - flake8 meinberlin tests --exclude migrations,settings + - npm run lint after_success: - coveralls deploy: diff --git a/Makefile b/Makefile index d94c780f93..a913ae4730 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ VIRTUAL_ENV ?= venv NODE_BIN = node_modules/.bin +SOURCE_DIRS = meinberlin tests .PHONY: all all: help @@ -24,7 +25,6 @@ help: @echo " make test-clean -- test on new database" @echo " make coverage -- write coverage report to dir htmlcov" @echo " make lint -- lint all project files" - @echo " make lint-quick -- lint all files staged in git" @echo " make po -- create new po files from the source" @echo " make compilemessages -- create new mo files from the translated po files" @echo " make release -- build everything required for a release" @@ -90,11 +90,12 @@ coverage: .PHONY: lint lint: - . $(VIRTUAL_ENV)/bin/activate && $(NODE_BIN)/polylint - -.PHONY: lint-quick -lint-quick: - . $(VIRTUAL_ENV)/bin/activate && $(NODE_BIN)/polylint -SF + EXIT_STATUS=0; \ + $(VIRTUAL_ENV)/bin/isort --diff -rc -c $(SOURCE_DIRS) || EXIT_STATUS=$$?; \ + $(VIRTUAL_ENV)/bin/flake8 $(SOURCE_DIRS) --exclude migrations,settings || EXIT_STATUS=$$?; \ + npm run lint || EXIT_STATUS=$$?; \ + $(VIRTUAL_ENV)/bin/python manage.py makemigrations --dry-run --check --noinput || EXIT_STATUS=$$?; \ + exit $${EXIT_STATUS} .PHONY: po po: diff --git a/package.json b/package.json index c447d72a6b..9b219e988f 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,6 @@ "eslint-plugin-standard": "4.0.0", "husky": "2.2.0", "markdownlint-cli": "0.15.0", - "polylint.sh": "0.0.4", "stylelint": "10.0.1", "stylelint-config-standard": "18.3.0", "stylelint-declaration-strict-value": "1.1.3", @@ -81,12 +80,13 @@ "scripts": { "build:prod": "webpack --config webpack.prod.js --mode production", "build": "webpack --config webpack.dev.js --mode development", - "watch": "webpack --config webpack.dev.js --watch --mode development" + "watch": "webpack --config webpack.dev.js --watch --mode development", + "lint": "eslint 'meinberlin/apps/**/*.{js,jsx}' && stylelint 'meinberlin/assets/scss/**/*.scss' --syntax scss" }, "browserslist": "last 3 versions, ie >= 11", "husky": { "hooks": { - "pre-commit": "make lint-quick" + "pre-commit": "make lint" } } }