Skip to content

Commit

Permalink
Merge in argus-htmx
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Nov 25, 2024
2 parents 205becf + e06adbe commit 18efc43
Show file tree
Hide file tree
Showing 132 changed files with 7,475 additions and 0 deletions.
8 changes: 8 additions & 0 deletions merge/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Format all python with ruff
47f713ddce20e3c751e3cbd05a8671dda8f9a054
# Format all HTML with djLint
0cd2a6561291dabccf435f19aca3f96323097e8b
# Format login form with djLint
07313f9fbb9384489c6aa57885f3fecba358f288
# Reformat middleware file using ruff
bc456a556e0df11b0f25420c5c6933c068adef10
1 change: 1 addition & 0 deletions merge/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bat eol=crlf
35 changes: 35 additions & 0 deletions merge/.github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Verify formatting

on:
push:
branches: main
pull_request:

jobs:
ruff:
runs-on: ubuntu-latest
name: Verify Python formatting
steps:
- uses: actions/checkout@v4

- uses: astral-sh/ruff-action@v1
with:
args: "format --check"
changed-files: 'true'

djlint:
runs-on: ubuntu-latest
name: Check HTML formatting
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5

- name: Install dependencies
run: |
pip install -U pip
pip install djlint
- name: Format HTML
run: djlint . --check
33 changes: 33 additions & 0 deletions merge/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint codebase

on:
push:
branches: main
pull_request:

jobs:
ruff:
runs-on: ubuntu-latest
name: Lint Python
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
with:
changed-files: 'true'

djlint:
runs-on: ubuntu-latest
name: Lint HTML
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5

- name: Install dependencies
run: |
pip install -U pip
pip install djlint
- name: Lint
run: djlint --lint .
23 changes: 23 additions & 0 deletions merge/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.*

*.egg
*.egg-info
*.py[cio]
*.sw?

__pycache__/
build/
dist/

# Tailwind CSS
src/argus_htmx/static/styles.css
# Autogenerated via management command
src/argus_htmx/tailwindtheme/tailwind.config.js
# OS specific
src/argus_htmx/tailwindtheme/tailwindcss

!.git-blame-ignore-revs
!.gitattributes
!.gitignore
!.pre-commit-config.yaml
!.github
20 changes: 20 additions & 0 deletions merge/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
- repo: https://github.com/djlint/djLint
rev: v1.35.4
hooks:
- id: djlint-reformat-django
- id: djlint-django
28 changes: 28 additions & 0 deletions merge/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.PHONY: clean testclean distclean coverageclean nuke tailwind

TAILWINDDIR=src/argus_htmx/tailwindtheme
STATICDIR=src/argus_htmx/static

clean:
-find . -name __pycache__ -print0 | xargs -0 rm -rf
-find . -name "*.pyc" -print0 | xargs -0 rm -rf
-find . -name "*.egg-info" -print0 | xargs -0 rm -rf
-find . -name ".ruff_cache" -print0 | xargs -0 rm -rf

distclean:
-rm -rf ./dist
-rm -rf ./build

coverageclean:
-rm .coverage
-rm .coverage.*
-rm coverage.xml
-rm -rf htmlcov

testclean: coverageclean clean
-rm -rf .tox

nuke: clean distclean testclean

tailwind:
tailwindcss -c $(TAILWINDDIR)/tailwind.config.js -i $(TAILWINDDIR)/styles.css -o $(STATICDIR)/styles.css
Loading

0 comments on commit 18efc43

Please sign in to comment.