@@ -0,0 +1,27 @@
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+indent_style = space
+[Makefile]
+indent_style = tab
+[*.py]
+charset = utf-8
+indent_size = 4
+max_line_length = 120
+[*.js]
+[*.{html,rst,md}]
+[*.{js,ts,tsx,json,yml,yaml,css,scss}]
+indent_size = 2
+[*.md]
+trim_trailing_whitespace = false
+default_language_version:
+ node: system
+ python: python3
+repos:
+ - repo: https://github.com/psf/black
+ rev: 22.3.0
+ hooks:
+ - id: black
+ language_version: python3
+ args: ["--target-version", "py37"]
+ - repo: https://github.com/timothycrosley/isort
+ # isort config is in setup.cfg
+ rev: 5.6.4
+ - id: isort
+ - repo: https://gitlab.com/pycqa/flake8
+ # flake8 config is in setup.cfg
+ rev: 3.8.4
+ - id: flake8
+ additional_dependencies:
+ - flake8-comprehensions
+ - flake8-assertive
+ - repo: https://github.com/rtts/djhtml
+ rev: v1.4.13
+ - id: djhtml
@@ -0,0 +1,17 @@
+.PHONY: lint format
+help:
+ @echo "lint - check style with black, flake8, sort python with isort, and indent html"
+ @echo "format - enforce a consistent code style across the codebase and sort python files with isort"
+lint:
+ black --target-version py37 --check --diff .
+ flake8
+ isort --check-only --diff .
+ curlylint --parse-only bakerydemo
+ git ls-files '*.html' | xargs djhtml --check
+format:
+ black --target-version py37 .
+ isort .
+ git ls-files '*.html' | xargs djhtml -i
@@ -1,4 +1,10 @@
[flake8]
max-line-length=120
-exclude=migrations
-ignore=F405,W503
+exclude=venv,.venv,bakerydemo/settings/local.py
+ignore=E501,F405,W503
+[isort]
+profile=black
+skip=migrations,.git,__pycache__,LC_MESSAGES,venv,.venv
+blocked_extensions=rst,html,js,svg,txt,css,scss,png,snap,ts,tsx
+default_section=THIRDPARTY