From 24c5adf463298b7dfa8c022f261077ef192e2769 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 1 Jan 2021 14:36:42 +0100 Subject: [PATCH] chore(devel): merge flake8 and yapf config into setup.cfg (#28) --- .flake8 | 19 ++----------------- .style.yapf | 6 ------ setup.cfg | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 23 deletions(-) delete mode 100644 .style.yapf create mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 index 83ef6c0..9de460d 100644 --- a/.flake8 +++ b/.flake8 @@ -1,18 +1,3 @@ [flake8] -ignore = D102, D103, D107, D202, W503 -max-line-length = 99 -inline-quotes = double -exclude = - .git - .tox - __pycache__ - build - dist - tests - *.pyc - *.egg-info - .cache - .eggs - env* -application-import-names = ansiblelater -format = ${cyan}%(path)s:%(row)d:%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s +# Requires `flake8-colors`. This is the formatting suggested by the package (and used in flake8 repository itself). +format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s diff --git a/.style.yapf b/.style.yapf deleted file mode 100644 index 42c7789..0000000 --- a/.style.yapf +++ /dev/null @@ -1,6 +0,0 @@ -[style] -based_on_style = google -column_limit = 99 -dedent_closing_brackets = true -coalesce_brackets = true -split_before_logical_operator = true diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..0111df1 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,24 @@ +[flake8] +# Explanation of errors +# +# D102: Missing docstring in public method +# D103: Missing docstring in public function +# D107: Missing docstring in __init__ +# D202: No blank lines allowed after function docstring +# W503:Line break occurred before a binary operator +ignore = D102, D103, D107, D202, W503 +max-line-length = 99 +inline-quotes = double +exclude = .git, __pycache__, build, dist, test, *.pyc, *.egg-info, .cache, .eggs, env* +# NOTE: The format for flake8 output is set in the `.flake8` file. This is separate +# because `setup.cfg` is parsed on setup, but it would require flake8-colors +# to run successfully (which will only be available after install). So we define +# it in `.flake8`, and it seems to successfully combine the settings in the +# two files together. + +[yapf] +based_on_style = google +column_limit = 99 +dedent_closing_brackets = true +coalesce_brackets = true +split_before_logical_operator = true