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

Flake8 linting is incompatible with the black formatting #1087

Closed
Ark-kun opened this issue Mar 17, 2022 · 3 comments · Fixed by googleapis/synthtool#1379 or #1126
Closed

Flake8 linting is incompatible with the black formatting #1087

Ark-kun opened this issue Mar 17, 2022 · 3 comments · Fixed by googleapis/synthtool#1379 or #1126
Assignees
Labels
aiplatform Issues related to the AI Platform (Unified) API. api: aiplatform Issues related to the AI Platform API. type: cleanup An internal cleanup or hygiene concern.

Comments

@Ark-kun
Copy link
Contributor

Ark-kun commented Mar 17, 2022

Black formats

machine_spec = {
    "machine_type": "n1-standard-2",
}

to

"machine_spec = {"machine_type": "n1-standard-2",}

But Flake8 fails with error:

nox > python -m pip install flake8 black==19.10b0
nox > black --check docs google tests noxfile.py setup.py
All done! ✨ 🍰 ✨
669 files would be left unchanged.
nox > flake8 google tests
tests/system/aiplatform/test_project_id_inference.py:41:65: E231 missing whitespace after ','
nox > Command flake8 google tests failed with exit code 1
nox > Session lint failed.

See the log: https://source.cloud.google.com/results/invocations/4fc606fe-ddd0-4edc-ad78-66c695279171/targets/cloud-devrel%2Fclient-libraries%2Fpython%2Fgoogleapis%2Fpython-aiplatform%2Fpresubmit%2Fpresubmit/log

@busunkim96 busunkim96 added the aiplatform Issues related to the AI Platform (Unified) API. label Mar 17, 2022
@morgandu
Copy link
Contributor

can you remove the ',' and try black then flake again?

@morgandu morgandu self-assigned this Mar 17, 2022
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Mar 17, 2022
@Ark-kun
Copy link
Contributor Author

Ark-kun commented Mar 17, 2022

This understandably works.
However my point still stands - the presubmit tests should only include one style test. Otherwise conflicts are inevitable.

BTW, the repo uses an old version of black. People with new version of black installed have their contributions fail presubmits.

@busunkim96 busunkim96 added the api: aiplatform Issues related to the AI Platform API. label Mar 17, 2022
@morgandu morgandu assigned parthea and unassigned morgandu Mar 18, 2022
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Mar 22, 2022
@morgandu morgandu removed the triage me I really want to be triaged. label Mar 22, 2022
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Mar 22, 2022
@kweinmeister kweinmeister added type: cleanup An internal cleanup or hygiene concern. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Mar 29, 2022
@parthea
Copy link
Contributor

parthea commented Mar 30, 2022

This will be fixed in googleapis/synthtool#1379

@parthea parthea reopened this Mar 30, 2022
gcf-merge-on-green bot pushed a commit that referenced this issue Mar 30, 2022
Source-Link: googleapis/synthtool@7ff4aad
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244

Fixes: #1087
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aiplatform Issues related to the AI Platform (Unified) API. api: aiplatform Issues related to the AI Platform API. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
6 participants