From 66bfc5324870d5fe30b9538a50edfcb64620c366 Mon Sep 17 00:00:00 2001 From: Jeffrey Triplett Date: Wed, 27 Sep 2023 19:24:59 -0500 Subject: [PATCH] :gear: Adds pre-commit and lint just command --- .pre-commit-config.yaml | 47 +++++++++++++++++++++++++++++++++++++++++ justfile | 3 +++ 2 files changed, 50 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1c7c5c3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,47 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-json + - id: check-merge-conflict + - id: check-symlinks + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + alias: autoformat + - id: trailing-whitespace + alias: autoformat +- repo: https://github.com/asottile/pyupgrade + rev: v3.13.0 + hooks: + - id: pyupgrade + args: [--py36-plus] +- repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black + args: [ + "." + ] + alias: autoformat + additional_dependencies: ['click==8.0.4'] +- repo: https://github.com/asottile/blacken-docs + rev: 1.16.0 + hooks: + - id: blacken-docs + alias: autoformat + additional_dependencies: ['black==22.1.0', 'click==8.0.4'] +- repo: https://github.com/charliermarsh/ruff-pre-commit + # Ruff version. + rev: 'v0.0.291' + hooks: + - id: ruff + # Respect `exclude` and `extend-exclude` settings. + args: + - "--fix" + exclude: /migrations/ + alias: autoformat diff --git a/justfile b/justfile index 5aec168..dfd6381 100644 --- a/justfile +++ b/justfile @@ -18,3 +18,6 @@ --session "test_django_version" \ --session "test_python_version" \ {{ ARGS }} + +lint: + python -m nox --reuse-existing-virtualenvs --session "lint"