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 formatting (CI or pre-commit) #531

Open
gideongrinberg opened this issue Oct 12, 2020 · 1 comment
Open

Add code formatting (CI or pre-commit) #531

gideongrinberg opened this issue Oct 12, 2020 · 1 comment
Labels
administrative CI/CD Related to our CI/CD pipeline discussion Issues that more just discussing than specific flaws or features enhancement

Comments

@gideongrinberg
Copy link
Contributor

As discussed in #286 we might want to format code automatically. This could complement the linting that happens in our CI builds. Our two options would be adding formatting to the CI (not sure if that works, I know linting does) or using pre-commit. Pre-commit allows for linting and formatting before pushing. This enforces clean code, makes devs think about best practices and improves code review. This would be in addition to, not instead of, the CI checks.

Pre-Commit In Action

Demo Repo

Failed Hook

image

Sucessful Hook

image

@gideongrinberg
Copy link
Contributor Author

See also #524 which discusses a style guide. If we want, we can set up either Flake8 or a formatter to follow this guide. If we have best practices for writing PPB programs (using PPB, not for PPB) we can also build a plugin for that.

@pathunstrom pathunstrom added administrative CI/CD Related to our CI/CD pipeline discussion Issues that more just discussing than specific flaws or features enhancement labels Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
administrative CI/CD Related to our CI/CD pipeline discussion Issues that more just discussing than specific flaws or features enhancement
Projects
None yet
Development

No branches or pull requests

2 participants