8000 Format Python code with black and isort by cclauss · Pull Request #201 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

Format Python code with black and isort #201

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

Closed
wants to merge 2 commits into from
Closed

Conversation

cclauss
Copy link
Contributor
@cclauss cclauss commented May 4, 2022

Adds spellchecking and Python linting to the GitHub Action

black --skip-string-normalization .

isort --profile black .

codespell --count --skip="*.js,*.json"

flake8 --builtins=Element,PyItemTemplate,PyListTemplate --max-complexity=10 --max-line-length=88

Copy link
Contributor
@barnwell barnwell left a comment

Choose a reason for hiding this comment

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

Looks good to me. I left 2 minor comments.

"""
From https://www.learnpythonwithrune.org/numpy-compute-mandelbrot-set-by-vectorization/.
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the "From" prefix doesn't seem necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could put From on a separate line.

@@ -68,7 +72,7 @@ def format_mime(obj):
format_dict, md_dict = mimebundle
else:
format_dict = mimebundle
md_dict = {}
md_dict = {} # noqa: F841
Copy link
Contributor

Choose a reason for hiding this comment

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

md_dict can be removed if it's not used. We shouldn't add the noqa here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@fpliger fpliger requested a review from mattkram May 5, 2022 03:55
@jezdez
Copy link
Member
jezdez commented May 5, 2022

@cclauss How would you feel about moving the linting config to pre-commit, so we make it easier to use locally, cross-platform and allow us to expand it to cover other types of code quality checks? /cc @mattkram

@fpliger fpliger requested a review from jezdez May 5, 2022 15:24
@pww217
Copy link
Contributor
pww217 commented May 5, 2022

Added a PR for the pre-commit app to use black and isort.

#235

CC: @mattkram

@pww217 pww217 added the tag: tests Related to tests label May 5, 2022
@mattkram
Copy link
Contributor
mattkram commented May 5, 2022

@cclauss Thank you for the PR and for prompting this discussion. As @pww217 mentioned, we're working to integrate these types of formatting checks and linting into pre-commit.

Thank you for introducing me to codespell too! It looks like there is a pre-commit hook available for that tool too, which I will investigate.

Tomorrow is FOSS Friday at Anaconda, and I will return to this PR after integrating some additional pre-commit hooks for any remaining items.

@mattkram mattkram added the status: paused PR that has been put on hold label May 5, 2022
@cclauss cclauss closed this May 5, 2022
@cclauss cclauss deleted the black branch May 5, 2022 21:04
@fpliger fpliger added the status: superseded PR that has been superseded by another PR label May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: paused PR that has been put on hold status: superseded PR that has been superseded by another PR tag: tests Related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0