Skip to content

Add yapf #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,10 @@ repos:
hooks:
- id: typos

- repo: https://github.com/google/yapf.git
rev: v0.43.0
hooks:
- id: yapf


... # EOF
13 changes: 13 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#


[style]

based_on_style = pep8
blank_line_before_class_docstring = false
blank_line_before_nested_class_or_def = true
blank_line_before_module_docstring = true
dedent_closing_brackets = true


# EOF
22 changes: 9 additions & 13 deletions conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
""" Sphinx documentation generator configuration
"""


AUTHOR = 'sinoroc'
MASTER_DOCUMENT = 'contents'
SUBTITLE = 'Bits of knowledge'
TITLE = 'Sinoroc KB'


#
# General
#
Expand All @@ -26,14 +24,12 @@
'src/_templates',
]


#
# Project
#

project = TITLE


#
# HTML
#
Expand All @@ -59,18 +55,19 @@
html_use_modindex = False
html_use_index = False


#
# Latex
#

latex_documents = [(
MASTER_DOCUMENT,
'{}.tex'.format(TITLE.lower().replace(' ', '')),
TITLE,
AUTHOR,
'manual',
)]
latex_documents = [
(
MASTER_DOCUMENT,
'{}.tex'.format(TITLE.lower().replace(' ', '')),
TITLE,
AUTHOR,
'manual',
)
]

latex_elements = {
'papersize': 'a4paper',
Expand All @@ -81,5 +78,4 @@

latex_toplevel_sectioning = 'part'


# EOF
4 changes: 4 additions & 0 deletions src/python/fizz_buzz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3


class Injector:

def __init__(self, multiple, word):
Expand All @@ -12,6 +13,7 @@ def __call__(self, value):
result = self._output
return result


def fizz_buzz(start, end):
injectors = [
Injector(3, 'Fizz'),
Expand All @@ -34,9 +36,11 @@ def fizz_buzz(start, end):
#
print(output)


def main():
fizz_buzz(1, 50)


if __name__ == '__main__':
main()

Expand Down