Skip to content

Commit a42bcf5

Browse files
committed
Add yapf
1 parent 4c00822 commit a42bcf5

File tree

4 files changed

+31
-13
lines changed

4 files changed

+31
-13
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,10 @@ repos:
5151
hooks:
5252
- id: typos
5353

54+
- repo: https://github.com/google/yapf.git
55+
rev: v0.43.0
56+
hooks:
57+
- id: yapf
58+
5459

5560
... # EOF

.style.yapf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
3+
4+
[style]
5+
6+
based_on_style = pep8
7+
blank_line_before_class_docstring = false
8+
blank_line_before_nested_class_or_def = true
9+
blank_line_before_module_docstring = true
10+
dedent_closing_brackets = true
11+
12+
13+
# EOF

conf.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
""" Sphinx documentation generator configuration
22
"""
33

4-
54
AUTHOR = 'sinoroc'
65
MASTER_DOCUMENT = 'contents'
76
SUBTITLE = 'Bits of knowledge'
87
TITLE = 'Sinoroc KB'
98

10-
119
#
1210
# General
1311
#
@@ -26,14 +24,12 @@
2624
'src/_templates',
2725
]
2826

29-
3027
#
3128
# Project
3229
#
3330

3431
project = TITLE
3532

36-
3733
#
3834
# HTML
3935
#
@@ -59,18 +55,19 @@
5955
html_use_modindex = False
6056
html_use_index = False
6157

62-
6358
#
6459
# Latex
6560
#
6661

67-
latex_documents = [(
68-
MASTER_DOCUMENT,
69-
'{}.tex'.format(TITLE.lower().replace(' ', '')),
70-
TITLE,
71-
AUTHOR,
72-
'manual',
73-
)]
62+
latex_documents = [
63+
(
64+
MASTER_DOCUMENT,
65+
'{}.tex'.format(TITLE.lower().replace(' ', '')),
66+
TITLE,
67+
AUTHOR,
68+
'manual',
69+
)
70+
]
7471

7572
latex_elements = {
7673
'papersize': 'a4paper',
@@ -81,5 +78,4 @@
8178

8279
latex_toplevel_sectioning = 'part'
8380

84-
8581
# EOF

src/python/fizz_buzz.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22

3+
34
class Injector:
45

56
def __init__(self, multiple, word):
@@ -12,6 +13,7 @@ def __call__(self, value):
1213
result = self._output
1314
return result
1415

16+
1517
def fizz_buzz(start, end):
1618
injectors = [
1719
Injector(3, 'Fizz'),
@@ -34,9 +36,11 @@ def fizz_buzz(start, end):
3436
#
3537
print(output)
3638

39+
3740
def main():
3841
fizz_buzz(1, 50)
3942

43+
4044
if __name__ == '__main__':
4145
main()
4246

0 commit comments

Comments
 (0)