Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind configuration #32

Merged
merged 15 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
lint-and-test:
runs-on: ubuntu-latest
container:
image: ghcr.io/commonknowledge/do-app-baseimage-django-node:364385f9d196a2bbe2d5faea025520cc0316501f
image: ghcr.io/commonknowledge/do-app-baseimage-django-node:ec719be0d63e9628fb34604ce198c679084c3eeb
# Workaround for: https://github.com/actions/checkout/issues/211
options: --user 1001
volumes:
Expand All @@ -30,6 +30,6 @@ jobs:
- uses: actions/cache@v2
with:
path: /home/runner/docker/.cache/poetry
key: do-app-baseimage-django-node:364385f9d196a2bbe2d5faea025520cc0316501f-poetry-${{ hashFiles('poetry.lock') }}
key: do-app-baseimage-django-node:ec719be0d63e9628fb34604ce198c679084c3eeb-poetry-${{ hashFiles('poetry.lock') }}
- run: make install
- run: make ci
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ wagtail-localize/
___wagtail-localize/
hotosm-website-old/
*.conf

# Env
create/
14 changes: 13 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ repos:
types: [python]
language: python

- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.19.6
hooks:
# Fixes indentation
- id: djlint-django
files: "app/"
args: [--reformat]
# Reports on quote mark misuse etc.
- id: djlint-django
files: "app/"
args: [--lint]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
Expand All @@ -44,7 +56,7 @@ repos:
language: python

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.0
rev: v3.0.0-alpha.4
hooks:
# Format JS
- id: prettier
153 changes: 153 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
### Prettier
# Ignore artifacts:
dist
static
Expand All @@ -6,3 +7,155 @@ node_modules
*.html
docs/api
docs/components

### Dupe of .gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
static/*
media/*
vite/*

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# JS
node_modules

# Local
local.py
.DS_Store

# Docs artifacts
docs/api
docs/components

# Misc
hotosm-website-old/
*.conf

# Env
create/
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PYTHON := python

.PHONY: install
install:
poetry --version
poetry install -n
yarn

Expand Down Expand Up @@ -35,8 +36,10 @@ bootstrap: install pre-commit-install migrate setup-cms
.PHONY: codestyle
codestyle:
poetry run pyupgrade --exit-zero-even-if-changed --py38-plus **/*.py
poetry run djlint --version
poetry run djlint app/templates/ --reformat
poetry run isort --version
poetry run isort --settings-path ./pyproject.toml ./
poetry run isort --gitignore --settings-path ./pyproject.toml ./
poetry run black --version
poetry run black --config ./pyproject.toml ./
yarn prettier --write .
Expand All @@ -49,13 +52,15 @@ formatting: codestyle

.PHONY: test
test:
poetry run pytest
poetry run pytest app/
yarn test

.PHONY: check-codestyle
check-codestyle:
poetry run djlint --version
poetry run djlint app/templates/ --lint
poetry run isort --version
poetry run isort --diff --check-only --settings-path ./pyproject.toml ./
poetry run isort --diff --gitignore --check-only --settings-path ./pyproject.toml ./
poetry run black --version
poetry run black --diff --check --config pyproject.toml ./
poetry run darglint --docstring-style google --verbosity 2 pyck
Expand Down
1 change: 1 addition & 0 deletions app/static/app/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions app/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{% extends "base.html" %}

{% block body_class %}template-404{% endblock %}

{% block body_class %}
template-404
{% endblock body_class %}
{% block content %}
<h1>Page not found</h1>

<h1 class="leading-tight sm:leading-none text-gray-900 font-extrabold">Page not found</h1>
<h2>Sorry, this page could not be found.</h2>
{% endblock %}
{% endblock content %}
21 changes: 8 additions & 13 deletions app/templates/500.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8" />
<title>Internal server error</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<h1>Internal server error</h1>

<h2>Sorry, there seems to be an error. Please try again soon.</h2>
</body>
</html>
{% extends "base.html" %}
{% block body_class %}
template-500
{% endblock body_class %}
{% block content %}
<h1 class="leading-tight sm:leading-none text-gray-900 font-extrabold">Server error</h1>
<h2>Sorry, there seems to be an error. Please try again soon.</h2>
{% endblock content %}
Loading