From b77ec53346c82ea0e1c95b5b813e2224d5bf7480 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Wed, 23 Dec 2020 13:09:17 +0100 Subject: [PATCH] Update some tools --- .editorconfig | 20 +++++++------------- .pre-commit-config.yaml | 4 ++++ Pipfile | 1 + makefile | 13 +++++++++---- pyproject.toml | 7 +++++++ 5 files changed, 28 insertions(+), 17 deletions(-) diff --git a/.editorconfig b/.editorconfig index b8fc407..ed9a8ec 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# https://editorconfig.org/ +# http://editorconfig.org root = true @@ -12,7 +12,7 @@ charset = utf-8 # Docstrings and comments use max_line_length = 79 [*.py] -max_line_length = 119 +max_line_length = 80 # Use 2 spaces for the HTML files [*.html] @@ -21,16 +21,16 @@ indent_size = 2 # The JSON files contain newlines inconsistently [*.json] indent_size = 2 -insert_final_newline = ignore +insert_final_newline = unset [**/admin/js/vendor/**] -indent_style = ignore -indent_size = ignore +indent_style = unset +indent_size = unset # Minified JavaScript files shouldn't be changed [**.min.js] -indent_style = ignore -insert_final_newline = ignore +indent_style = unset +insert_final_newline = unset # Makefiles always use tabs for indentation [Makefile] @@ -39,9 +39,3 @@ indent_style = tab # Batch files use tabs for indentation [*.bat] indent_style = tab - -[docs/**.txt] -max_line_length = 79 - -[makefile] -indent_style = tab diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c25c948..e453f4c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,9 @@ fail_fast: true repos: + - repo: https://github.com/twu/skjold + rev: v0.1.6 + hooks: + - id: skjold - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: diff --git a/Pipfile b/Pipfile index 9025785..be9022b 100644 --- a/Pipfile +++ b/Pipfile @@ -11,6 +11,7 @@ rope = "*" safety = "*" flake8 = "*" pre-commit= "*" +skjold = "*" [packages] django = ">=3.1.0" diff --git a/makefile b/makefile index b9b8ef9..0c27ea0 100644 --- a/makefile +++ b/makefile @@ -18,15 +18,20 @@ install: env ## Make venv and install requirements pre-commit autoupdate migrate: ## Make and run migrations - $(PYTHON) manage.py makemigrations - $(PYTHON) manage.py migrate + pipenv run manage.py makemigrations + pipenv run manage.py migrate .PHONY: test test: ## Run tests - $(PYTHON) $(APP_DIR)/manage.py test application --verbosity=0 --parallel --failfast + pipenv run skjold -v audit Pipenv.lock + pipenv run python manage.py test application --verbosity=0 --parallel --failfast .PHONY: run run: ## Run the Django server - $(PYTHON) $(APP_DIR)/manage.py runserver + pipenv run python manage.py runserver start: install migrate run ## Install requirements, apply migrations, then start development server + +.PHONY: check +check: ## Run checks on the packages + pipenv run skjold -v audit Pipenv.lock diff --git a/pyproject.toml b/pyproject.toml index dfab025..b8c3ec9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,3 +14,10 @@ exclude = ''' | dist )/ ''' + +[tool.skjold] +sources = ["github", "pyup", "gemnasium"] # Sources to check against. +report_only = true # Report only, always exit with zero. +cache_dir = '.skylt_cache' # Cache location (default: `~/.skjold/cache`). +cache_expires = 86400 # Cache max. age. +verbose = true # Be verbose.