Skip to content

Commit

Permalink
Added Makefile and some config files
Browse files Browse the repository at this point in the history
  • Loading branch information
n8creator committed Dec 12, 2023
1 parent 01452bc commit 405d990
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .djlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"max_line_length": "120"
}
47 changes: 47 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

# Docstrings and comments use max_line_length = 79
[*.py]
profile = black
max_line_length = 88
max-line-length = 88

# Use 2 spaces for the HTML files
[*.html]
indent_size = 2

# The JSON files contain newlines inconsistently
[*.json]
indent_size = 2
insert_final_newline = ignore

[**/admin/js/vendor/**]
indent_style = ignore
indent_size = ignore

# Minified JavaScript files shouldn't be changed
[**.min.js]
indent_style = ignore
insert_final_newline = ignore

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab

# Batch files use tabs for indentation
[*.bat]
indent_style = tab

[docs/**.txt]
max_line_length = 79

[*.yml]
indent_size = 2
8 changes: 8 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[flake8]
exclude =
migrations,
__pycache__,
manage.py,
settings.py,

max-line-length = 88
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files.associations": {
"**/*.html": "html",
"**/templates/*.html": "django-html",
"**/templates/**/*.html": "django-html",
"**/templates/**/*": "django-txt",
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
},
"emmet.includeLanguages": {
"django-html": "html"
},
"[html][django-html][handlebars][hbs][mustache][jinja][jinja-html][nj][njk][nunjucks][twig]": {
"editor.defaultFormatter": "monosans.djlint"
}
}
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Install project
install:
@poetry install

# Lint project
isort:
@poetry run isort task_manager

black:
@poetry run black task_manager

lint: black
@poetry run flake8 task_manager

# Run tests
test:
@poetry run ./manage.py test

# Start & deploy project
start:
@poetry run ./manage.py runserver 0.0.0.0:8000

migrate:
poetry run ./manage.py migrate

deploy:
git push dokku main

# System commands for Makefile
MAKEFLAGS += --no-print-directory

.PHONY: install isort black lint test start migrate deploy
89 changes: 74 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ packages = [
python = "^3.10"
django = "^5.0"
gunicorn = "^21.2.0"
psycopg2 = "^2.9.9"
whitenoise = "^6.6.0"
django-filter = "^23.5"
django-bootstrap5 = "^23.3"
python-dotenv = "^1.0.0"
dj-database-url = "^2.1.0"
psycopg2-binary = "^2.9.9"


[tool.poetry.group.test.dependencies]
Expand Down

0 comments on commit 405d990

Please sign in to comment.