Skip to content

Commit 0ec32a3

Browse files
author
Hugo Osvaldo Barrera
committed
Reformat code using yapf
1 parent 89074ed commit 0ec32a3

18 files changed

+485
-499
lines changed

docs/source/conf.py

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
None,
3131
configspec=specpath,
3232
stringify=False,
33-
list_values=False
33+
list_values=False,
3434
)
3535
validator = validate.Validator()
3636
config.validate(validator)
@@ -52,7 +52,9 @@ def write_section(section, secname, key, comment, file_):
5252
fun_args = []
5353
if fun_name == 'integer' and len(fun_args) == 2:
5454
fun_name += ', allowed values are between {} and {}'.format(
55-
fun_args[0], fun_args[1])
55+
fun_args[0],
56+
fun_args[1],
57+
)
5658
fun_args = []
5759
file_.write('\n')
5860
if fun_name in ['expand_db_path', 'expand_path']:
@@ -89,8 +91,13 @@ def write_section(section, secname, key, comment, file_):
8991
file_.write('\n')
9092
comments = spec[secname]['__many__'].comments
9193
for key, comment in sorted(comments.items()):
92-
write_section(spec[secname]['__many__'][key], secname,
93-
key, comment, file_)
94+
write_section(
95+
spec[secname]['__many__'][key],
96+
secname,
97+
key,
98+
comment,
99+
file_,
100+
)
94101
else:
95102
write_section(spec[secname][key], secname, key, comment, file_)
96103

@@ -181,7 +188,6 @@ def write_section(section, secname, key, comment, file_):
181188
# If true, `todo` and `todoList` produce output, else they produce nothing.
182189
todo_include_todos = True
183190

184-
185191
# -- Options for HTML output ----------------------------------------------
186192

187193
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -314,8 +320,13 @@ def write_section(section, secname, key, comment, file_):
314320
# (source start file, target name, title,
315321
# author, documentclass [howto, manual, or own class]).
316322
latex_documents = [
317-
(master_doc, 'Todoman.tex', 'Todoman Documentation',
318-
'Hugo Osvaldo Barrera', 'manual'),
323+
(
324+
master_doc,
325+
'Todoman.tex',
326+
'Todoman Documentation',
327+
'Hugo Osvaldo Barrera',
328+
'manual',
329+
),
319330
]
320331

321332
# The name of an image file (relative to this directory) to place at the top of
@@ -338,29 +349,36 @@ def write_section(section, secname, key, comment, file_):
338349
# If false, no module index is generated.
339350
# latex_domain_indices = True
340351

341-
342352
# -- Options for manual page output ---------------------------------------
343353

344354
# One entry per manual page. List of tuples
345355
# (source start file, name, description, authors, manual section).
346-
man_pages = [
347-
(master_doc, 'todoman', 'Todoman Documentation',
348-
[author], 1)
349-
]
356+
man_pages = [(
357+
master_doc,
358+
'todoman',
359+
'Todoman Documentation',
360+
[author],
361+
1,
362+
)]
350363

351364
# If true, show URL addresses after external links.
352365
# man_show_urls = False
353366

354-
355367
# -- Options for Texinfo output -------------------------------------------
356368

357369
# Grouping the document tree into Texinfo files. List of tuples
358370
# (source start file, target name, title, author,
359371
# dir menu entry, description, category)
360372
texinfo_documents = [
361-
(master_doc, 'Todoman', 'Todoman Documentation',
362-
author, 'Todoman', 'One line description of project.',
363-
'Miscellaneous'),
373+
(
374+
master_doc,
375+
'Todoman',
376+
'Todoman Documentation',
377+
author,
378+
'Todoman',
379+
'One line description of project.',
380+
'Miscellaneous',
381+
),
364382
]
365383

366384
# Documents to append as an appendix to all manuals.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
entry_points={
1515
'console_scripts': [
1616
'todo = todoman.cli:cli',
17-
]
17+
],
1818
},
1919
install_requires=open('requirements.txt').readlines(),
2020
long_description=open('README.rst').read(),

tests/conftest.py

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,29 @@ def default_database(tmpdir):
2424
@pytest.fixture
2525
def config(tmpdir, default_database):
2626
path = tmpdir.join('config')
27-
path.write('[main]\n'
28-
'path = {}/*\n'
29-
'date_format = %Y-%m-%d\n'
30-
'time_format = \n'
31-
'cache_path = {}\n'
32-
.format(str(tmpdir), str(tmpdir.join('cache.sqlite3'))))
27+
path.write(
28+
'[main]\n'
29+
'path = {}/*\n'
30+
'date_format = %Y-%m-%d\n'
31+
'time_format = \n'
32+
'cache_path = {}\n'
33+
.format(str(tmpdir), str(tmpdir.join('cache.sqlite3')))
34+
)
3335
return path
3436

3537

3638
@pytest.fixture
3739
def runner(config, sleep):
38-
3940
class SleepyCliRunner(CliRunner):
4041
"""
4142
Sleeps before invoking to make sure cache entries have expired.
4243
"""
44+
4345
def invoke(self, *args, **kwargs):
4446
sleep()
4547
return super().invoke(*args, **kwargs)
4648

47-
return SleepyCliRunner(env={
48-
'TODOMAN_CONFIG': str(config)
49-
})
49+
return SleepyCliRunner(env={'TODOMAN_CONFIG': str(config)})
5050

5151

5252
@pytest.fixture
@@ -55,9 +55,7 @@ def inner(name, content, list_name='default'):
5555
path = tmpdir.ensure_dir(list_name).join(name)
5656
path.write(
5757
'BEGIN:VCALENDAR\n'
58-
'BEGIN:VTODO\n' +
59-
content +
60-
'END:VTODO\n'
58+
'BEGIN:VTODO\n' + content + 'END:VTODO\n'
6159
'END:VCALENDAR'
6260
)
6361
return path
@@ -67,7 +65,6 @@ def inner(name, content, list_name='default'):
6765

6866
@pytest.fixture
6967
def now_for_tz():
70-
7168
def inner(tz='CET'):
7269
"""
7370
Provides the current time cast to a given timezone.
@@ -155,7 +152,6 @@ def inner():
155152

156153
@pytest.fixture
157154
def todos(default_database, sleep):
158-
159155
def inner(**filters):
160156
sleep()
161157
default_database.update_cache()
@@ -164,14 +160,15 @@ def inner(**filters):
164160
return inner
165161

166162

167-
settings.register_profile("ci", settings(
168-
max_examples=1000,
169-
verbosity=Verbosity.verbose,
170-
suppress_health_check=[HealthCheck.too_slow]
171-
))
172-
settings.register_profile("deterministic", settings(
173-
derandomize=True,
174-
))
163+
settings.register_profile(
164+
"ci",
165+
settings(
166+
max_examples=1000,
167+
verbosity=Verbosity.verbose,
168+
suppress_health_check=[HealthCheck.too_slow]
169+
)
170+
)
171+
settings.register_profile("deterministic", settings(derandomize=True,))
175172

176173
if os.getenv('DETERMINISTIC_TESTS', 'false').lower() == 'true':
177174
settings.load_profile("deterministic")

tests/test_backend.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,22 @@ def test_sequence_increment(default_database, todo_factory, todos):
9292
def test_normalize_datetime():
9393
writter = VtodoWritter(None)
9494
assert (
95-
writter.normalize_datetime(date(2017, 6, 17)) ==
96-
datetime(2017, 6, 17, tzinfo=tzlocal())
95+
writter.normalize_datetime(date(2017, 6, 17)) == datetime(
96+
2017, 6, 17, tzinfo=tzlocal()
97+
)
9798
)
9899
assert (
99-
writter.normalize_datetime(datetime(2017, 6, 17)) ==
100-
datetime(2017, 6, 17, tzinfo=tzlocal())
100+
writter.normalize_datetime(datetime(2017, 6, 17)) == datetime(
101+
2017, 6, 17, tzinfo=tzlocal()
102+
)
101103
)
102104
assert (
103-
writter.normalize_datetime(datetime(2017, 6, 17, 12, 19)) ==
104-
datetime(2017, 6, 17, 12, 19, tzinfo=tzlocal())
105+
writter.normalize_datetime(datetime(2017, 6, 17, 12, 19)) == datetime(
106+
2017, 6, 17, 12, 19, tzinfo=tzlocal()
107+
)
105108
)
106109
assert (
107110
writter.normalize_datetime(
108111
datetime(2017, 6, 17, 12, tzinfo=tzlocal())
109-
) ==
110-
datetime(2017, 6, 17, 12, tzinfo=tzlocal())
112+
) == datetime(2017, 6, 17, 12, tzinfo=tzlocal())
111113
)

0 commit comments

Comments
 (0)