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 code style support for Python #41

Closed
3 tasks
grayside opened this issue May 27, 2021 · 2 comments · Fixed by #128
Closed
3 tasks

Add code style support for Python #41

grayside opened this issue May 27, 2021 · 2 comments · Fixed by #128
Labels
help wanted We'd love to have community involvement on this issue. persona: maintainer [meta] Related to project maintenance. priority: p2 Moderately-important priority. Fix may not be included in next release. type: cleanup An internal cleanup or hygiene concern.

Comments

@grayside
Copy link
Collaborator

grayside commented May 27, 2021

Proposal

Follow-up #6 with code style support for Python. Per @dinagraves, use black of flake8.

  • Add a github action that runs lint & makes code suggestions for python code.
  • If we have local dev setup in place, add the same lint configuration to run locally.
  • For local dev, document the tools to use to align with our python style.

Problems this will solve

  • Keep consistent code style
  • Reduce human attention during reviews to address common readability challenges.
@grayside grayside added help wanted We'd love to have community involvement on this issue. type: cleanup An internal cleanup or hygiene concern. priority: p2 Moderately-important priority. Fix may not be included in next release. persona: maintainer [meta] Related to project maintenance. labels May 27, 2021
ace-n pushed a commit that referenced this issue Jun 2, 2021
@dinagraves
Copy link
Contributor

We use the following flake8 args in python-docs-samples. https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile-template.py#L131

I don't know if there is a way to make flake8 automatically fix the style and import issues it finds. If we want to do that, we might want to use black for the linting and isort with autoflake for the imports.

@ace-n
Copy link
Contributor

ace-n commented Jun 4, 2021

(Also: we may be able to use black for local linting and perform the rest via GitHub Actions.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We'd love to have community involvement on this issue. persona: maintainer [meta] Related to project maintenance. priority: p2 Moderately-important priority. Fix may not be included in next release. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
3 participants