diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d4cf45f8..050d5b11d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -221,4 +221,4 @@ jobs: python -m pip install --upgrade tox - name: Test with tox - run: tox -e docs,style,packaging + run: tox -e docs,packaging diff --git a/.gitignore b/.gitignore index df5a2d10c..6caa61357 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,5 @@ docs/_build example/db.sqlite3 htmlcov .tox -node_modules -package-lock.json geckodriver.log coverage.xml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ce264484..7e6cd3f8b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,6 +38,8 @@ repos: - id: eslint files: \.js?$ types: [file] + args: + - --fix - repo: https://github.com/psf/black rev: 21.11b1 hooks: diff --git a/Makefile b/Makefile index 5b5ca4d76..1600496e5 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,4 @@ -.PHONY: flake8 example test coverage translatable_strings update_translations - -PRETTIER_TARGETS = '**/*.(css|js)' - -style: package-lock.json - isort . - black --target-version=py36 . - flake8 - npx eslint --ignore-path .gitignore --fix . - npx prettier --ignore-path .gitignore --write $(PRETTIER_TARGETS) - ! grep -r '\(style=\|onclick=\|\|\|`__ to format code and additionally uses flake8 and isort. The toolbar uses `pre-commit `__ to automatically apply our style guidelines -when a commit is made. If necessary this can be bypassed using:: +when a commit is made. Set up pre-commit before committing with: + + $ pre-commit install + +If necessary you can bypass pre-commit locally with:: $ git commit --no-verify +Note that it runs on CI. To reformat the code manually use:: - $ make style + $ pre-commit run --all-files Patches ------- diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index 7250ed750..8eddeba4a 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -21,6 +21,7 @@ middleware middlewares multi neo +pre profiler psycopg py diff --git a/package.json b/package.json deleted file mode 100644 index 2e0e180bb..000000000 --- a/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "devDependencies": { - "eslint": "^7.10.0", - "prettier": "^2.1.2" - } -} diff --git a/tox.ini b/tox.ini index 3a5d428e5..3abd404bc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,6 @@ [tox] envlist = docs - style packaging py{36,37}-dj{22,31,32}-{sqlite,postgresql,postgis,mysql} py{38,39}-dj{22,31,32,40,main}-{sqlite,postgresql,postgis,mysql} @@ -68,14 +67,6 @@ deps = Sphinx sphinxcontrib-spelling -[testenv:style] -commands = make style_check -deps = - black>=19.10b0 - flake8 - isort>=5.0.2 -skip_install = true - [testenv:packaging] commands = python setup.py sdist bdist_wheel