Skip to content

Commit

Permalink
refactor: move all configs to pyproject.toml (#1268)
Browse files Browse the repository at this point in the history
* refactor: simplify prettier regex

* refactor: move flake8 config to pyproject.toml

* refactor: move djlint config to pyproject.toml
  • Loading branch information
12rambau authored Mar 27, 2023
1 parent 7a7087a commit bb77900
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
10 changes: 0 additions & 10 deletions .djlintrc

This file was deleted.

7 changes: 0 additions & 7 deletions .flake8

This file was deleted.

4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ repos:
hooks:
- id: prettier
# Exclude the HTML, since it doesn't understand Jinja2
exclude: .+((\.html)|index\.(.+)\.css)$
# exclude also the webpack.congo.js file has it embed complete url dificult to prettify
exclude: .+\.html|webpack\.config\.js

- repo: https://github.com/psf/black
rev: 22.12.0
Expand All @@ -20,6 +21,7 @@ repos:
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,21 @@ dev = [

[tool.doc8]
ignore = ["D001"] # we follow a 1 line = 1 paragraph style

[tool.flake8]
# E203: space before ":" | needed for how black formats slicing
# E501: line too long | Black take care of it
# W503: line break before binary operator | Black take care of it
# W605: invalid escape sequence | we escape specific characters for sphinx
ignore = ["E203", "E501", "W503", "W605"]
exclude = ["setup.py", "docs/conf.py", "node_modules", "docs", "build", "dist"]

[tool.djlint]
profile = "jinja"
extension = "html"
indent = 2
max_line_length = 120
use_gitignore = true
format_js = true
format_css = true
ignore = "H006,J018,T003,H025"

0 comments on commit bb77900

Please sign in to comment.