-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
340-automatic-code-formatting #346
Conversation
/black |
This looks good overall. A few comments for making development easier for external contributors:
|
The config file is a good addition. To format the notebooks there is a Black plugin for Jupyter we could consider adding to do this when the notebooks are run. We had discussed the notebooks being run as part of the testing steps as well, the jupyter command can be used to run the cells of a notebook without the interface. As for line length I really think 120 is the reasonable length. 80 or 88 makes it hard to get a reasonable amount of code on screen, I find it seriously impacts comprehension when reading narrow vs. wide formatted code, especially with the line break needed to fit lines that aren't really that complex. I'm seeing less and less Python code formatted to 80/88 characters as well so the trend appears away from this. Jupyter, Github, and other interfaces seem to display code in a space more optimized for 120 or so characters rather than 80. |
I am fine with 120 characters. I was just pointing out that for a visually impaired person, 120 characters is not "reasonable", and that much research identified that "long lines" are harder to comprehend. I realize that much of the research is dedicated to newsprint, which has different dynamics than code. Again, I am fine with 120 characters. I do think it needs to be explicitly listed. |
Use compatible configuration options for black and flake8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for pushing this through.
/black |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is very huge but it seems like the expected formatting output.
Looks good to me.
Do you guys think we can skip this formatting process if PR doesn't have a format issue?
Or just apply it to all PRs, if so, maybe we should not allow it optional by "\black" keyword?
Thanks.
I think for now this auto formatting is an 'experimental' feature for the codebase. In the future we may drop it if It complicates our code review/merging process. or we may tweak it according to our code collaboration process. so I agree with your first option that we skip it if flake8 doesn't complain. |
Fixes #340.
Description
this ('opinionated') coding style change affects many areas, would like to get more reviews for this PR @Nic-Ma @ericspod @atbenmurray @hjmjohnson
Status
READY
Types of changes