Skip to content

Commit

Permalink
Merge pull request #1 from jxhnx/feat/add-linting
Browse files Browse the repository at this point in the history
feat: add linting
  • Loading branch information
jxhnx authored Oct 26, 2024
2 parents 1d0446a + e0b4c7a commit 045a1a7
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 12 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint

on:
push: {}

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Run pre-commit
uses: pre-commit/[email protected]
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
default_stages: [pre-commit]

default_language_version:
python: python3.12

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: detect-private-key

- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.3
hooks:
- id: prettier
args: ['--tab-width', '2', '--single-quote']
exclude: '\.(js|jsx|ts|tsx|scss|css|html)$'

- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.35.1
hooks:
- id: djlint-reformat-django
- id: djlint-django
28 changes: 16 additions & 12 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ Django Allauth templates with basic DaisyUI styling. You can find a list of avai

1. Copy the contents of the templates directory into your templates folder.
2. If not done already, register the templates in your settings.py, e.g., with:
```
TEMPLATES = [
{
"DIRS": [
str(APPS_DIR / "templates"),
],
"APP_DIRS": True,
...
},
]
```
3. Make sure to adjust the entry template `base.html` in `templates/allauth/layouts/entrance.html` and `templates/allauth/layouts/manage.html`
```
TEMPLATES = [
{
"DIRS": [
str(APPS_DIR / "templates"),
],
"APP_DIRS": True,
...
},
]
```
3. Make sure to adjust the entry template `base.html` in `templates/allauth/layouts/entrance.html` and `templates/allauth/layouts/manage.html`

## Development

This project uses `pre-commit`. Make sure to have it installed, e.g., in your python environment, to pass all checks.
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ==== djLint ====
[tool.djlint]
blank_line_after_tag = "load,extends"
close_void_tags = true
format_css = true
format_js = true
ignore = "H006,H030,H031"
include = "H017,H035"
indent = 2
profile = "django"

[tool.djlint.css]
indent_size = 2

[tool.djlint.js]
indent_size = 2

0 comments on commit 045a1a7

Please sign in to comment.