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

Adopt Black and check conformance in downstream repos #49

Merged
merged 3 commits into from
Jul 26, 2019
Merged

Conversation

tbekolay
Copy link
Member

Motivation and context:
Black automatically handles a lot of Python style decisions that we've spent time talking about in the past, freeing up our time for more important matters.

The only thing that I wasn't able to do in this PR is auto-format notebooks, though doing so is very close with black-nb. There are only a few minor issues with it, and rather than deal with them now, I chose to defer that to later. See #48 for details.

Interactions with other PRs:
Any other PR that touches Python code will have to be reformatted with Black. It shouldn't be very difficult though, as most of the changes in this PR are either straightforward or can be ignored and re-applied by running black again.

How has this been tested?
Ran the static tests locally with and without black formatted code to ensure that checks are raised correctly.

How long should this take to review?

  • Quick (less than 40 lines changed or changes are straightforward)

Types of changes:

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have read the CONTRIBUTING.rst document.
  • I have updated the documentation accordingly.
  • I have included a changelog entry.
  • [na] I have added tests to cover my changes.
  • I have run the test suite locally and all tests passed.

docs/style.rst Outdated Show resolved Hide resolved
docs/examples/configuration.ipynb Show resolved Hide resolved
.nengobones.yml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
nengo_bones/templates/pyproject.toml.template Show resolved Hide resolved
nengo_bones/templates/pyproject.toml.template Outdated Show resolved Hide resolved
nengo_bones/templates/pyproject.toml.template Outdated Show resolved Hide resolved
@tbekolay
Copy link
Member Author

Pushed some commits to address Dan's review comments.

Copy link
Member

@drasmuss drasmuss left a comment

Choose a reason for hiding this comment

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

Added a fixup to add a test for the exclude parameter, and fix a small formatting error that revealed.

nengo_bones/tests/test_config.py Show resolved Hide resolved
nengo_bones/templates.py Outdated Show resolved Hide resolved
.nengobones.yml Outdated Show resolved Hide resolved
@drasmuss drasmuss force-pushed the black branch 3 times, most recently from 2179031 to eb0afff Compare July 26, 2019 13:05
Copy link
Member

@drasmuss drasmuss left a comment

Choose a reason for hiding this comment

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

All looks good to me now, will merge after after Trevor OK's the fixups

CHANGES.rst Show resolved Hide resolved
@tbekolay
Copy link
Member Author

Fixups all look good to me! Only thing that'd be nice before merge is to add that changelog entry, which I'll leave to you @drasmuss.

tbekolay and others added 2 commits July 26, 2019 10:58
Check to ensure that files are black formatted in static checks.

Add pre-commit-config.yaml to run Black as a precommit hook.

Automatically run black on any Python template rendered by Bones.
@drasmuss drasmuss merged commit a156d73 into master Jul 26, 2019
@drasmuss drasmuss deleted the black branch July 26, 2019 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants