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

ref: workaround flake8 B314 #18116

Merged
merged 2 commits into from
Apr 7, 2020
Merged

ref: workaround flake8 B314 #18116

merged 2 commits into from
Apr 7, 2020

Conversation

joshuarli
Copy link
Member

Right now, black fails to parse this file due to psf/black#768:

$ pre-commit run black --files src/sentry/lint/engine.py      black....................................................................Failed
hookid: black

error: cannot format src/sentry/lint/engine.py: Cannot parse: 175:101:         print('[sentry.lint] Skipping JavaScript formatting because prettier is not installed.', file=sys.stderr)  # noqa: B314
All done! 💥 💔 💥
1 file failed to reformat.

@dcramer This blocks running pre-commit run -a in CI.

Also, even if it were able to blacken this file, it'd be conflicting with flake8 because the noqa: B314 which disallows print statements needs to be placed on the same line as the print call. Black will coerce it to multiple lines.

Easiest solution would to just switch to the appropriate sys write. cc @untitaker because I know you've run into this before.

@joshuarli joshuarli requested a review from dcramer April 6, 2020 22:10
@joshuarli joshuarli merged commit 6c4f6c1 into master Apr 7, 2020
@joshuarli joshuarli deleted the ref/workaround-flake8-b314 branch April 7, 2020 19:59
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants