Skip to content

Commit

Permalink
Merge pull request #2181 from liqd/ka-2019-04-linting
Browse files Browse the repository at this point in the history
use eslint instead of pylint
  • Loading branch information
rmader authored May 7, 2019
2 parents 5e60076 + fc4a957 commit 05d6087
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
VIRTUAL_ENV ?= venv
NODE_BIN = node_modules/.bin
SOURCE_DIRS = meinberlin tests

.PHONY: all
all: help
Expand All @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
}

0 comments on commit 05d6087

Please sign in to comment.