encode / hostedapi

Building out an example Starlette service 💚
https://hostedapi.herokuapp.com/
93 stars 10 forks source link

Use pre-commit #79

Closed devsetgo closed 4 years ago

devsetgo commented 4 years ago

First, love this example. It has helped understand some parts of Starlette.

I would suggest using pre-commit to maintain code quality standards such as black. For example below is what I have in my own .pre-commit-config.yaml. This would eliminate the need to run a script for black or other code standard enforcement.

Black is run (config is in a setup.cfg), fix-encoding-pragma adds "# -- coding: utf-8 -- to the top of python files", trailing-whitespace "This hook trims trailing whitespace", and python-safety-dependencies-check to check for security vulnerabilities.

repos:

tomchristie commented 4 years ago

Thanks for the recommendation! 😀 Our CI currently enforces black and other linting, and I'm happy with the workflow, so going to pass on this.