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

Add nbqa to pre-commit config #997

Merged
merged 5 commits into from
Jan 29, 2021
Merged

Conversation

StanczakDominik
Copy link
Member

  • I have added a changelog entry for this pull request.
  • If adding new functionality, I have added tests and
    docstrings.
  • I have fixed any newly failing tests.

@namurphy
Copy link
Member

Interesting! I haven't used nbqa before but it seems really helpful.

Copy link
Member

@namurphy namurphy left a comment

Choose a reason for hiding this comment

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

Looks like nbqa had lots of tiny fixes but this looks like it's going to be helpful in making our notebooks nice and consistent. Thank you again for this and #996!

@@ -287,7 +304,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.9.1"
Copy link
Member

Choose a reason for hiding this comment

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

This line makes me happy.

Comment on lines +25 to +33
- repo: https://github.com/nbQA-dev/nbQA
rev: 0.5.7
hooks:
- id: nbqa-black
additional_dependencies: [black==19.10b0]
args: [--nbqa-mutate]
- id: nbqa-isort
additional_dependencies: [isort==5.7.0]
args: [--nbqa-mutate]
Copy link
Member

Choose a reason for hiding this comment

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

Again, this is nice readable code.

@StanczakDominik
Copy link
Member Author

https://github.com/PlasmaPy/PlasmaPy/runs/1792630778 shows just about how it'd show up before committing if actually using pre-commit (as I keep telling people to... 😅 ), or if a notebook has errors. It's probably easiest to apply those fixes by installing pre-commit and running it :D

@StanczakDominik
Copy link
Member Author

Anyway, my point is: if you're fine with how this outputs, feel free to merge :)

@namurphy namurphy merged commit b468391 into PlasmaPy:master Jan 29, 2021
@StanczakDominik StanczakDominik deleted the nbqa branch January 29, 2021 20:09
@StanczakDominik StanczakDominik added this to the 0.6.0 milestone Mar 12, 2021
rocco8773 added a commit to rocco8773/PlasmaPy that referenced this pull request Mar 14, 2021
@namurphy namurphy added the linters Code linters and autoformatters label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linters Code linters and autoformatters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants