Skip to content

Commit 9344f9e

Browse files
committed
added black for formatting
1 parent 3925c6d commit 9344f9e

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

cookiecutter.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"full_name": "Firstname Lastname",
3-
"email": "example@example.com",
4-
"git_username": "some-username",
2+
"full_name": "Firstname Lastname",
3+
"email": "example@example.com",
4+
"git_username": "some-username",
55
"git_repo_name": "some-repo-name",
6-
"git_url": "https://github.com/some-username/some-repo-name",
7-
"app_description": "A short description",
8-
"app_version": "0.1.0",
6+
"git_url": "https://github.com/{{ cookiecutter.git_username }}/{{ cookiecutter.git_repo_name }}",
7+
"app_description": "A short description",
8+
"app_version": "0.1.0",
99
"app_documents_location": ["readthedocs.io", "github-pages"],
1010
"app_documents_theme": ["sphinx_rtd_theme", "alabaster"],
1111
"__app_name": "{{ cookiecutter.git_repo_name.lower().replace(' ', '_').replace('-', '_') }}",
@@ -14,7 +14,7 @@
1414
"include_webpages": ["n", "y"],
1515
"container_runtime": ["podman", "docker"],
1616
"__template_repo": "https://github.com/btr1975/cookiecutter-python-fastapi-openapi",
17-
"__template_version": "1.0.8",
17+
"__template_version": "1.0.9",
1818
"_new_lines":"\n",
1919
"_copy_without_render": [
2020
"{{cookiecutter.__app_name}}/templates",
@@ -23,7 +23,7 @@
2323
"__prompts__": {
2424
"full_name": "Your Full Name",
2525
"email": "Your E-Mail Address",
26-
"git_username": "Your GitHub Username",
26+
"git_username": "Your GitHub Username or GitHub Organization Name",
2727
"git_repo_name": "The Repository Name",
2828
"git_url": "The full GIT URL",
2929
"app_description": "A short description",

{{cookiecutter.git_repo_name}}/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Makefile for project needs
22
# Author: Ben Trachtenberg
3-
# Version: 1.0.6
3+
# Version: 1.0.7
44
#
55

6-
.PHONY: info build build-container coverage pylint pytest gh-pages build dev-run start-container \
6+
.PHONY: info build build-container coverage format pylint pytest gh-pages build dev-run start-container \
77
stop-container remove-container
88

99
info:
@@ -12,6 +12,7 @@ info:
1212
@echo " build-container To build a container image"
1313
@echo " coverage To run coverage and display ASCII and output to htmlcov"
1414
@echo " dev-run To run the app"
15+
@echo " format To format the code with black"
1516
@echo " pylint To run pylint"
1617
@echo " pytest To run pytest with verbose option"
1718
@echo " start-container To start the container"
@@ -35,6 +36,9 @@ build-container:
3536
coverage:
3637
@pytest --cov --cov-report=html -vvv
3738

39+
format:
40+
@black {{cookiecutter.__app_name}}/
41+
3842
pylint:
3943
@pylint {{cookiecutter.__app_name}}/
4044

{{cookiecutter.git_repo_name}}/make.bat

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@ECHO OFF
22
REM Makefile for project needs
33
REM Author: Ben Trachtenberg
4-
REM Version: 1.0.4
4+
REM Version: 1.0.5
55
REM
66

77
IF "%1" == "build" (
@@ -29,6 +29,11 @@ IF "%1" == "dev-run" (
2929
GOTO END
3030
)
3131

32+
IF "%1" == "format" (
33+
black {{cookiecutter.__app_name}}/
34+
GOTO END
35+
)
36+
3237
{% if cookiecutter.app_documents_location == 'github-pages' %}
3338
IF "%1" == "gh-pages" (
3439
rmdir /s /q docs\source\code
@@ -42,6 +47,7 @@ IF "%1" == "gh-pages" (
4247
@ECHO build To build a distribution
4348
@ECHO coverage To run coverage and display ASCII and output to htmlcov
4449
@ECHO dev-run To run the app
50+
@ECHO format To format the code with black
4551
@ECHO pylint To run pylint
4652
@ECHO pytest To run pytest with verbose option
4753
{% if cookiecutter.app_documents_location == 'github-pages' %}@ECHO gh-pages To create the GitHub pages{% endif %}

{{cookiecutter.git_repo_name}}/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ notes = [
8989
"XXX",
9090
]
9191
fail-under = 9.9
92+
93+
[tool.black]
94+
line-length = 120

{{cookiecutter.git_repo_name}}/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
-r requirements.txt
55
build
6+
black
67
tomli
78
pytest-cov
89
sphinx

{{cookiecutter.git_repo_name}}/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# They DO NOT inculde libraries needed to develop or test our app
33
#
44
fastapi
5+
pydantic
56
uvicorn
67
{% if cookiecutter.use_requests == 'y' %}requests{% endif %}
78
{% if cookiecutter.use_cryptography == 'y' %}cryptography{% endif %}

0 commit comments

Comments
 (0)