diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41acb96..a087748 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,5 +51,10 @@ repos: hooks: - id: typos + - repo: https://github.com/google/yapf.git + rev: v0.43.0 + hooks: + - id: yapf + ... # EOF diff --git a/.style.yapf b/.style.yapf new file mode 100644 index 0000000..a75d1fd --- /dev/null +++ b/.style.yapf @@ -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 diff --git a/conf.py b/conf.py index 769a5ea..09ac8e7 100644 --- a/conf.py +++ b/conf.py @@ -1,13 +1,11 @@ """ Sphinx documentation generator configuration """ - AUTHOR = 'sinoroc' MASTER_DOCUMENT = 'contents' SUBTITLE = 'Bits of knowledge' TITLE = 'Sinoroc KB' - # # General # @@ -26,14 +24,12 @@ 'src/_templates', ] - # # Project # project = TITLE - # # HTML # @@ -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', @@ -81,5 +78,4 @@ latex_toplevel_sectioning = 'part' - # EOF diff --git a/src/python/fizz_buzz.py b/src/python/fizz_buzz.py index cad8530..4f24f00 100755 --- a/src/python/fizz_buzz.py +++ b/src/python/fizz_buzz.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 + class Injector: def __init__(self, multiple, word): @@ -12,6 +13,7 @@ def __call__(self, value): result = self._output return result + def fizz_buzz(start, end): injectors = [ Injector(3, 'Fizz'), @@ -34,9 +36,11 @@ def fizz_buzz(start, end): # print(output) + def main(): fizz_buzz(1, 50) + if __name__ == '__main__': main()