Skip to content
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

Start auto-formatting using yapf #66

Merged
merged 5 commits into from
Jan 13, 2021
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
26 changes: 1 addition & 25 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
[flake8]
# NOTE: The idea is to start with non-critical checks disabled
# so that we can activate flake8 without a huge diff
# upfront to already benefit from all still enabled checks,
# and remove issue a class at a time, potentially
# even multiple at once if we start using an auto-reformatter.
# E124 closing bracket does not match visual indentation
# E123 closing bracket does not match indentation of opening bracket's line
# E125 continuation line with same indent as next logical line
# E126 continuation line over-indented for hanging indent
# E127 continuation line over-indented for visual indent
# E128 continuation line under-indented for visual indent
# E221 multiple spaces before operator
# E241 multiple spaces after ','
# E251 unexpected spaces around keyword / parameter equals
# E501 line too long (xxx > 79 characters)
# W503 line break before binary operator
# W504 line break after binary operator
ignore =
E124
E123
E125
E126
E127
E128
E221
E241
E251
E501
W503
W504
max-line-length = 99
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ repos:
rev: v1.0.1
hooks:
- id: rst-linter

# TODO Move to https://github.com/google/yapf
# after >=0.31 has been released
- repo: https://github.com/pre-commit/mirrors-yapf/
rev: v0.30.0
hooks:
- id: yapf
4 changes: 4 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[style]
based_on_style = pep8
column_limit = 99
split_before_arithmetic_operator = True
Loading