From b77ec53346c82ea0e1c95b5b813e2224d5bf7480 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Wed, 23 Dec 2020 13:09:17 +0100 Subject: [PATCH 1/7] 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. From 6080d2d46032d7e03c60ef0ff2838754474f5a76 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Wed, 23 Dec 2020 13:33:55 +0100 Subject: [PATCH 2/7] Update makefile --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index ce1e17a..3718e00 100644 --- a/makefile +++ b/makefile @@ -33,4 +33,4 @@ start: install migrate run ## Install requirements, apply migrations, then start .PHONY: check check: ## Run checks on the packages - pipenv run skjold -v audit Pipenv.lock + pipenv run skjold -v audit Pipfile.lock From 5917bdd11ad348206a376d059020f10f6839f059 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Wed, 23 Dec 2020 13:36:40 +0100 Subject: [PATCH 3/7] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e453f4c..0d14cfa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,6 +7,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: + - id: no-commit-to-branch - id: trailing-whitespace language: python - repo: https://github.com/ambv/black From 468605b43cb0c827c3829ba773110770b48614b5 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Wed, 23 Dec 2020 13:47:31 +0100 Subject: [PATCH 4/7] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 54 +++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0d14cfa..67ecca8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,25 +1,33 @@ 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: - - id: no-commit-to-branch - - id: trailing-whitespace - language: python - - repo: https://github.com/ambv/black - rev: stable - hooks: - - id: black - language_version: python3.8 - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 - hooks: - - id: flake8 - - repo: https://github.com/asottile/blacken-docs - rev: v1.8.0 - hooks: - - id: blacken-docs + - repo: https://github.com/twu/skjold + rev: v0.1.6 + hooks: + - id: skjold + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-merge-conflict + - id: check-symlinks + - id: check-toml + - id: check-xml + - id: check-yaml + - id: fix-encoding-pragma + - id: forbid-new-submodules + - id: mixed-line-ending + - id: trailing-whitespace + language: python + - id: no-commit-to-branch + - repo: https://github.com/ambv/black + rev: 20.8b1 + hooks: + - id: black + language_version: python3.8 + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.8.4 + hooks: + - id: flake8 + - repo: https://github.com/asottile/blacken-docs + rev: v1.9.1 + hooks: + - id: blacken-docs From 8e335d77d1823a82804705cc65687d1c6464f141 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Wed, 23 Dec 2020 14:19:00 +0100 Subject: [PATCH 5/7] Update makefile --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 3718e00..58a4f88 100644 --- a/makefile +++ b/makefile @@ -22,7 +22,7 @@ migrate: ## Make and run migrations .PHONY: test test: ## Run tests - pipenv run skjold -v audit Pipenv.lock + pipenv run skjold -v audit Pipfile.lock pipenv run python manage.py test application --verbosity=0 --parallel --failfast .PHONY: run From 248307d334ac1e4246e0bc0fc155bb75a5891e54 Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Thu, 24 Dec 2020 12:06:16 +0100 Subject: [PATCH 6/7] Reformatting Pipfile and makefile Changing some package for my personal template for python projects --- Pipfile | 6 ------ makefile | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Pipfile b/Pipfile index ef4bb79..da0b4e6 100644 --- a/Pipfile +++ b/Pipfile @@ -6,9 +6,6 @@ verify_ssl = true [dev-packages] pylint = "*" pylint-django = "*" -autopep8 = "*" -rope = "*" -safety = "*" flake8 = "*" pre-commit= "*" skjold = "*" @@ -22,6 +19,3 @@ django-guardian = ">=2.3.0" [requires] python_version = "3.9" - -[pipenv] -allow_prereleases = true diff --git a/makefile b/makefile index 58a4f88..61ffab6 100644 --- a/makefile +++ b/makefile @@ -23,7 +23,7 @@ migrate: ## Make and run migrations .PHONY: test test: ## Run tests pipenv run skjold -v audit Pipfile.lock - pipenv run python manage.py test application --verbosity=0 --parallel --failfast + pipenv run python manage.py test --verbosity=0 --parallel --failfast .PHONY: run run: ## Run the Django server From 24b3d25e7853e21220f3643222609d8b2b67b09a Mon Sep 17 00:00:00 2001 From: Fundor333 Date: Thu, 7 Jan 2021 19:24:16 +0100 Subject: [PATCH 7/7] Delete main.yml --- .github/workflows/main.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index b372ddb..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Run Django tests - -on: push - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - name: Install dependencies - run: make install - - name: Run tests - run: make test