8000 CI: Use black for code formatting by TomAugspurger · Pull Request #237 · dask/dask-ml · GitHub
[go: up one dir, main page]

Skip to content
8000

CI: Use black for code formatting #237

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

Merged
merged 3 commits into from
Jul 19, 2018
Merged

Conversation

TomAugspurger
Copy link
Member

Just as an exercise to see if this would work.

I'm 50/50 on whether this is a good idea or not.

@TomAugspurger
Copy link
Member Author

If we do decide to go forward with this, we should wait till large outstanding PRs are in. This branch will be relatively easy to update.

@codecov
Copy link
codecov bot commented Jun 28, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@5ebfa0e). Click here to learn what that means.
The diff coverage is 90.72%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #237   +/-   ##
========================================
  Coverage          ?   93.2%           
========================================
  Files             ?      30           
  Lines             ?    1677           
  Branches          ?       0           
========================================
  Hits              ?    1563           
  Misses            ?     114           
  Partials          ?       0
Impacted Files Coverage Δ
dask_ml/compat.py 0% <0%> (ø)
dask_ml/preprocessing/label.py 91.66% <100%> (ø)
dask_ml/neural_network.py 100% <100%> (ø)
dask_ml/linear_model/utils.py 75% <100%> (ø)
dask_ml/_compat.py 100% <100%> (ø)
dask_ml/linear_model/perceptron.py 100% <100%> (ø)
dask_ml/_utils.py 100% <100%> (ø)
dask_ml/decomposition/truncated_svd.py 97.67% <100%> (ø)
dask_ml/metrics/regression.py 90% <100%> (ø)
dask_ml/linear_model/passive_aggressive.py 100% <100%> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ebfa0e...dca7219. Read the comment docs.

@TomAugspurger
Copy link
Member Author

Also added coverage to the py36 build (turned off comments for now).

kwargs,
)
for i in range(nblocks)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm for black (it'd save me time), but this one-element-per-line is one formatting option I dislike, especially for many options.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black does have support for # fmt: off and # fmt: on flags to stop Black's formatting. I think we should use those if Black is used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... Agreed that this is less pleasant.

However, I'm inclined to do all or nothing here. Locally, I would set up a pre-commit hook and then never worry about it again :)

@mrocklin
Copy link
Member
mrocklin commented Jun 28, 2018 via email

@TomAugspurger
Copy link
Member Author
TomAugspurger commented Jun 28, 2018

@stsievert will wait for your +/- 1 here.

Will also wait for large PRs (hypberband) to be merged first, if we go ahead with it.

@stsievert
Copy link
Member
stsievert commented Jun 28, 2018

👍, though that's dependent on being able to use # fmt in future PRs

@stsievert
Copy link
Member

Should we add black's .flake8 config? https://github.com/ambv/black/blob/master/.flake8 I got some errors about line length and binary operators after I formatted the Hyperband PR with black. They would have been resolved with their config.

though that's dependent on being able to use # fmt in future PRs

Maybe not. Not having to think about formatting would be really nice.

@TomAugspurger
Copy link
Member Author

Should we add black's .flake8 config? https://github.com/ambv/black/blob/master/.flake8 I got some errors about line length and binary operators after I formatted the Hyperband PR with black.

https://github.com/dask/dask-ml/pull/237/files#diff-380c6a8ebbbce17d55d50ef17d3cf906 has the changes to linting settings so that flake8 still passes.

Not having to think about formatting would be really nice.

That's the hope :)

@TomAugspurger
Copy link
Member Author

Rebased on master. Apologies for the force push, but I think having a clean git commit history of

  1. configuration changes
  2. auto-formatting
  3. manual fixups

is useful here.

I'd like to merge this today if possible. I'll follow up with commits to outstanding PRs to use the new style.

@TomAugspurger
Copy link
Member Author

Here goes.

@TomAugspurger TomAugspurger merged commit af8b621 into dask:master Jul 19, 2018
@TomAugspurger TomAugspurger deleted the black branch July 19, 2018 18:21
@TomAugspurger
Copy link
Member Author

Whoops, I just realized that I blew away the update to contributing.rst. Will do a followup now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0