Skip to content

Commit 0239bbb

Browse files
committed
pre-commit hooks with black formatter
1 parent 550632e commit 0239bbb

16 files changed

+139
-206
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ dmypy.json
130130

131131

132132
# macOS
133-
.DS_Store
133+
.DS_Store

.pre-commit-config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/psf/black
9+
rev: 19.3b0
10+
hooks:
11+
- id: black

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"python.testing.unittestEnabled": false,
33
"python.testing.pytestEnabled": true
4-
}
4+
}

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# tuttle - painless business planning for freelancers
22

33
> HARRY TUTTLE: Bloody paperwork. Huh!
4-
>
4+
>
55
> SAM LOWRY: I suppose one has to expect a certain amount.
66
>
7-
> HARRY TUTTLE: Why? I came into this game for the action, the excitement. Go anywhere, travel light, get in, get out, wherever there's trouble, a man alone.
7+
> HARRY TUTTLE: Why? I came into this game for the action, the excitement. Go anywhere, travel light, get in, get out, wherever there's trouble, a man alone.
88
99

10-
**Tuttle is an open-source software project supported by the [Prototype Fund](https://prototypefund.de/en/about-2/). We develop a finance and business planning tool tailored for the requirements of freelancers.**
10+
**Tuttle is an open-source software project supported by the [Prototype Fund](https://prototypefund.de/en/about-2/). We develop a finance and business planning tool tailored for the requirements of freelancers.**
1111

1212

1313
## Which challenges does the project address?
1414

15-
The working world is changing, the trend is towards freelancing: software developers, designers and journalists appreciate the freedom and creative possibilities of solo self-employment. More and more professionals are choosing it for themselves. It allows them to specialize and gain experience with many projects and clients.
15+
The working world is changing, the trend is towards freelancing: software developers, designers and journalists appreciate the freedom and creative possibilities of solo self-employment. More and more professionals are choosing it for themselves. It allows them to specialize and gain experience with many projects and clients.
1616

1717
With freelancing, there are many side activities: Marketing, client communication, legal and financial planning - although the latter probably appeals to few solo self-employed people. But neglected financial planning carries the risk of insolvency, debt, precarious self-employment, or poverty in old age. This also creates burdens for the social systems.
1818

@@ -23,10 +23,9 @@ But what if software could make financial planning in freelancing almost as easy
2323
With Tuttle, we are developing a financial planning tool that is tailored to the needs of solo freelancers. We automate and give freelancers more time to do the work they love.
2424
The application provides analysis and forecasting functions on income, expenses, disposable income, uncertainty management or explainability of the forecast and convinces with portability, among other things.
2525

26-
We develop the solution as a GUI application based on web technologies. Sensitive financial data is processed locally on the end device without central data collection. For data analysis, we rely on open source tools from the Python ecosystem.
26+
We develop the solution as a GUI application based on web technologies. Sensitive financial data is processed locally on the end device without central data collection. For data analysis, we rely on open source tools from the Python ecosystem.
2727

2828

2929
## Acknowledgements
3030

3131
This project is funded by the [Prototype Fund](https://prototypefund.de).
32-

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
theme: jekyll-theme-minimal
1+
theme: jekyll-theme-minimal

docs/conf.py

+23-31
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#
2020
import os
2121
import sys
22-
sys.path.insert(0, os.path.abspath('..'))
22+
23+
sys.path.insert(0, os.path.abspath(".."))
2324

2425
import tuttle
2526

@@ -31,22 +32,22 @@
3132

3233
# Add any Sphinx extension module names here, as strings. They can be
3334
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
34-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
35+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
3536

3637
# Add any paths that contain templates here, relative to this directory.
37-
templates_path = ['_templates']
38+
templates_path = ["_templates"]
3839

3940
# The suffix(es) of source filenames.
4041
# You can specify multiple suffix as a list of string:
4142
#
4243
# source_suffix = ['.rst', '.md']
43-
source_suffix = '.rst'
44+
source_suffix = ".rst"
4445

4546
# The master toctree document.
46-
master_doc = 'index'
47+
master_doc = "index"
4748

4849
# General information about the project.
49-
project = 'tuttle'
50+
project = "tuttle"
5051
copyright = "2021, Christian Staudt"
5152
author = "Christian Staudt"
5253

@@ -69,10 +70,10 @@
6970
# List of patterns, relative to source directory, that match files and
7071
# directories to ignore when looking for source files.
7172
# This patterns also effect to html_static_path and html_extra_path
72-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
73+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
7374

7475
# The name of the Pygments (syntax highlighting) style to use.
75-
pygments_style = 'sphinx'
76+
pygments_style = "sphinx"
7677

7778
# If true, `todo` and `todoList` produce output, else they produce nothing.
7879
todo_include_todos = False
@@ -83,7 +84,7 @@
8384
# The theme to use for HTML and HTML Help pages. See the documentation for
8485
# a list of builtin themes.
8586
#
86-
html_theme = 'alabaster'
87+
html_theme = "alabaster"
8788

8889
# Theme options are theme-specific and customize the look and feel of a
8990
# theme further. For a list of options available for each theme, see the
@@ -94,13 +95,13 @@
9495
# Add any paths that contain custom static files (such as style sheets) here,
9596
# relative to this directory. They are copied after the builtin static files,
9697
# so a file named "default.css" will overwrite the builtin "default.css".
97-
html_static_path = ['_static']
98+
html_static_path = ["_static"]
9899

99100

100101
# -- Options for HTMLHelp output ---------------------------------------
101102

102103
# Output file base name for HTML help builder.
103-
htmlhelp_basename = 'tuttledoc'
104+
htmlhelp_basename = "tuttledoc"
104105

105106

106107
# -- Options for LaTeX output ------------------------------------------
@@ -109,15 +110,12 @@
109110
# The paper size ('letterpaper' or 'a4paper').
110111
#
111112
# 'papersize': 'letterpaper',
112-
113113
# The font size ('10pt', '11pt' or '12pt').
114114
#
115115
# 'pointsize': '10pt',
116-
117116
# Additional stuff for the LaTeX preamble.
118117
#
119118
# 'preamble': '',
120-
121119
# Latex figure (float) alignment
122120
#
123121
# 'figure_align': 'htbp',
@@ -127,21 +125,15 @@
127125
# (source start file, target name, title, author, documentclass
128126
# [howto, manual, or own class]).
129127
latex_documents = [
130-
(master_doc, 'tuttle.tex',
131-
'tuttle Documentation',
132-
'Christian Staudt', 'manual'),
128+
(master_doc, "tuttle.tex", "tuttle Documentation", "Christian Staudt", "manual")
133129
]
134130

135131

136132
# -- Options for manual page output ------------------------------------
137133

138134
# One entry per manual page. List of tuples
139135
# (source start file, name, description, authors, manual section).
140-
man_pages = [
141-
(master_doc, 'tuttle',
142-
'tuttle Documentation',
143-
[author], 1)
144-
]
136+
man_pages = [(master_doc, "tuttle", "tuttle Documentation", [author], 1)]
145137

146138

147139
# -- Options for Texinfo output ----------------------------------------
@@ -150,13 +142,13 @@
150142
# (source start file, target name, title, author,
151143
# dir menu entry, description, category)
152144
texinfo_documents = [
153-
(master_doc, 'tuttle',
154-
'tuttle Documentation',
155-
author,
156-
'tuttle',
157-
'One line description of project.',
158-
'Miscellaneous'),
145+
(
146+
master_doc,
147+
"tuttle",
148+
"tuttle Documentation",
149+
author,
150+
"tuttle",
151+
"One line description of project.",
152+
"Miscellaneous",
153+
)
159154
]
160-
161-
162-

docs/index.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
**painless business planning for freelancers**
44

55
> HARRY TUTTLE:
6-
>
6+
>
77
> Bloody paperwork. Huh!
8-
>
8+
>
99
> SAM LOWRY:
10-
>
10+
>
1111
> I suppose one has to expect a certain amount.
1212
>
1313
> HARRY TUTTLE:
14-
>
15-
> Why? I came into this game for the action, the excitement. Go anywhere, travel light, get in, get out, wherever there's trouble, a man alone.
14+
>
15+
> Why? I came into this game for the action, the excitement. Go anywhere, travel light, get in, get out, wherever there's trouble, a man alone.
1616
1717

18-
**Tuttle is an open-source software project supported by the [Prototype Fund](https://prototypefund.de/en/about-2/). We develop a finance and business planning tool tailored for the requirements of freelancers.**
18+
**Tuttle is an open-source software project supported by the [Prototype Fund](https://prototypefund.de/en/about-2/). We develop a finance and business planning tool tailored for the requirements of freelancers.**
1919

2020

2121
## Which challenges does the project address?
2222

23-
The working world is changing, the trend is towards freelancing: software developers, designers and journalists appreciate the freedom and creative possibilities of solo self-employment. More and more professionals are choosing it for themselves. It allows them to specialize and gain experience with many projects and clients.
23+
The working world is changing, the trend is towards freelancing: software developers, designers and journalists appreciate the freedom and creative possibilities of solo self-employment. More and more professionals are choosing it for themselves. It allows them to specialize and gain experience with many projects and clients.
2424

2525
With freelancing, there are many side activities: Marketing, client communication, legal and financial planning - although the latter probably appeals to few solo self-employed people. But neglected financial planning carries the risk of insolvency, debt, precarious self-employment, or poverty in old age. This also creates burdens for the social systems.
2626

@@ -31,6 +31,4 @@ But what if software could make financial planning in freelancing almost as easy
3131
With Tuttle, we are developing a financial planning tool that is tailored to the needs of solo freelancers. We automate and give freelancers more time to do the work they love.
3232
The application provides analysis and forecasting functions on income, expenses, disposable income, uncertainty management or explainability of the forecast and convinces with portability, among other things.
3333

34-
We develop the solution as a GUI application based on web technologies. Sensitive financial data is processed locally on the end device without central data collection. For data analysis, we rely on open source tools from the Python ecosystem.
35-
36-
34+
We develop the solution as a GUI application based on web technologies. Sensitive financial data is processed locally on the end device without central data collection. For data analysis, we rely on open source tools from the Python ecosystem.

scripts/test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from tuttle import model
1+
from tuttle import model

setup.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,41 @@
44

55
from setuptools import setup, find_packages
66

7-
with open('README.md') as readme_file:
7+
with open("README.md") as readme_file:
88
readme = readme_file.read()
99

10-
with open('HISTORY.rst') as history_file:
10+
with open("HISTORY.rst") as history_file:
1111
history = history_file.read()
1212

13-
requirements = [ ]
13+
requirements = []
1414

15-
test_requirements = ['pytest>=3', ]
15+
test_requirements = ["pytest>=3"]
1616

1717
setup(
1818
author="Christian Staudt",
19-
author_email='mail@clstaudt.me',
20-
python_requires='>=3.6',
19+
author_email="mail@clstaudt.me",
20+
python_requires=">=3.6",
2121
classifiers=[
22-
'Development Status :: 2 - Pre-Alpha',
23-
'Intended Audience :: Developers',
24-
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
25-
'Natural Language :: English',
26-
'Programming Language :: Python :: 3',
27-
'Programming Language :: Python :: 3.6',
28-
'Programming Language :: Python :: 3.7',
29-
'Programming Language :: Python :: 3.8',
22+
"Development Status :: 2 - Pre-Alpha",
23+
"Intended Audience :: Developers",
24+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
25+
"Natural Language :: English",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.6",
28+
"Programming Language :: Python :: 3.7",
29+
"Programming Language :: Python :: 3.8",
3030
],
3131
description="Less paperwork, more excitement.",
3232
install_requires=requirements,
3333
license="GNU General Public License v3",
34-
long_description=readme + '\n\n' + history,
34+
long_description=readme + "\n\n" + history,
3535
include_package_data=True,
36-
keywords='tuttle',
37-
name='tuttle',
38-
packages=find_packages(include=['tuttle', 'tuttle.*']),
39-
test_suite='tests',
36+
keywords="tuttle",
37+
name="tuttle",
38+
packages=find_packages(include=["tuttle", "tuttle.*"]),
39+
test_suite="tests",
4040
tests_require=test_requirements,
41-
url='https://github.com/tuttle-dev/tuttle',
42-
version='0.1.0',
41+
url="https://github.com/tuttle-dev/tuttle",
42+
version="0.1.0",
4343
zip_safe=False,
4444
)

tests/test_calendar.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
from tuttle.calendar import FileCalendar
66

7+
78
def test_file_calendar():
89
"""Test that the calendar object can be instantiated."""
910
test_calendar_path = Path("tests/data/test_calendar.ics")
10-
cal = FileCalendar(path=test_calendar_path, name="Test Calendar")
11+
cal = FileCalendar(path=test_calendar_path, name="Test Calendar")

tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ deps =
2323
commands =
2424
pip install -U pip
2525
pytest --basetemp={envtmpdir}
26-

tuttle/app.py

+4-25
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,24 @@
66

77
import model
88

9-
from model import (
10-
Timesheet,
11-
Project,
12-
Invoice
13-
)
9+
from model import Timesheet, Project, Invoice
1410

1511

1612
class App:
1713
"""The main application class"""
1814

19-
def __init__(
20-
self,
21-
):
15+
def __init__(self,):
2216
self.home = Path.home() / ".tuttle"
2317
if not os.path.exists(self.home):
2418
os.mkdir(self.home)
2519
self.db_path = self.home / "tuttle.db"
2620
self.db_engine = sqlmodel.create_engine(f"sqlite:///{self.db_path}", echo=True)
2721
sqlmodel.SQLModel.metadata.create_all(self.db_engine)
2822

29-
30-
def generate_timesheet(
31-
self,
32-
project: Project,
33-
time_period
34-
) -> Timesheet:
23+
def generate_timesheet(self, project: Project, time_period) -> Timesheet:
3524
"""."""
3625
raise NotImplementedError("TODO")
3726

38-
def generate_invoice(
39-
timesheet: Timesheet
40-
) -> Invoice:
27+
def generate_invoice(timesheet: Timesheet) -> Invoice:
4128
"""."""
4229
raise NotImplementedError("TODO")
43-
44-
45-
46-
47-
48-
49-
50-

tuttle/banking.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99

1010

1111
class Banking:
12-
def __init__(
13-
self,
14-
account: BankAccount,
15-
):
12+
def __init__(self, account: BankAccount):
1613
self.account = account
1714
self.product_id = None # TODO: register product ID before deployment
1815

0 commit comments

Comments
 (0)