GoogleCloudPlatform / terraform-python-testing-helper

Simple Python test helper for Terraform.
https://pypi.org/project/tftest/
Apache License 2.0
214 stars 31 forks source link

Proposal: auto-format the codebase to follow PEP 8 and published Google style #80

Closed sodul closed 8 months ago

sodul commented 8 months ago

This project indentation is somewhat inconsistent: 2 spaces for core indentation (vs 4 in PEP 8), 4 spaces for data, vertically aligned on opening parentheses, multiline statements with arguments on the first line, etc...

The 2 spaces alone is going to be a turn off for many potential contributors. If you add ruff as a pre-commit hook and a CI pipeline check the codebase could easily become PEP 8 compliant and more readable.

https://peps.python.org/pep-0008/#indentation https://github.com/google/styleguide/blob/gh-pages/pyguide.md#34-indentation

https://pypi.org/project/ruff/

ludoo commented 8 months ago

2 is the internal standard at Google and we strongly prefer it. We have autoformatting, just have a quick look here

https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/blob/master/.github/workflows/linting.yml#L71

I don't think we plan to change our formatting style anytime soon, but thanks for thinking about it.