From 9b27961d48256011ba67e6706b8803305a8f0af4 Mon Sep 17 00:00:00 2001 From: Deimos Date: Sat, 21 Sep 2019 14:02:07 -0600 Subject: [PATCH] Add a hook to format Alembic revisions with Black Alembic 1.2.0 adds the ability to post-process revision scripts, so this uses that capability to automatically run any new files through Black. This always had to be done manually before, so it's nice to have it taken care of automatically like this. --- tildes/alembic.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tildes/alembic.ini b/tildes/alembic.ini index 9088ac0..0d0a182 100644 --- a/tildes/alembic.ini +++ b/tildes/alembic.ini @@ -2,6 +2,11 @@ script_location = alembic sqlalchemy.url = postgresql+psycopg2://tildes:@/tildes +[post_write_hooks] +hooks=black +black.type=console_scripts +black.entrypoint=black + # Logging configuration [loggers] keys = root,sqlalchemy,alembic