From f81b8d6672387bbb35fb4166a69d5903a0bec282 Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Wed, 17 Jul 2024 09:52:20 -0400 Subject: [PATCH] ci: init pre-commit hook for code reformatting - Use black for python, djlint for html, prettier for css and js Resolves: #117 --- .pre-commit-config.yaml | 18 ++++++++++++++++++ 1 file changed, 18 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..accb0b5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +repos: + - repo: https://github.com/psf/black + rev: 23.1a1 + hooks: + - id: black + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.3.2 + hooks: + - id: prettier + additional_dependencies: ["prettier@2.3.2"] + files: "\\.(js|jsx|ts|tsx|css|scss|less|json|yaml|yml|md)$" + + - repo: https://github.com/djlint/djLint + rev: v1.34.1 + hooks: + - id: djlint-reformat-django + - id: djlint-django