-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added YAPF Code Formatting #232
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #232 +/- ##
=======================================
Coverage 95.44% 95.44%
=======================================
Files 17 17
Lines 2259 2259
=======================================
Hits 2156 2156
Misses 103 103
Continue to review full report at Codecov.
|
I haven't gone through line-by-line, but overall this looks pretty clean / consistent. I saw that you put some disables in there where needed – thanks for the extra effort @ismacaulay. |
To ensure consistent code style, we would like to use
This style is written into a local You can locally disable the formatter by surrounding a block of code in To automatically style code whenever you commit, create a file called repos:
- repo: https://github.com/pre-commit/mirrors-yapf
sha: 'bb280692bd3b1e1f7fab174635ef9678f2452522'
hooks:
- id: yapf Install with: pip install pre-commit
pre-commit install Now you will automatically get styled code when you commit. |
Thanks @ismacaulay - I think we will hold off on this for now, though. I'm worried about discouraging contributions by requiring either strict style or an installed pre-commit hook. Also branches I tagged this work in case we decide to revisit: https://github.com/seequent/properties/tree/yapf-styling |
Those are fair concerns, and formatting can be revisited later if we so choose. |
Added
Yet Another Python Formatter
along with apre-commit
hook to help ensure consistent styling. This will help contributors meet the repository's expected styling. It will be enforced in the travis build just like pylint. See @bsmithyman comment below for more info on styling.