Changed autogenerated code so it fits 80 character limit

Declined
#11 · Created  · Last updated

Declined pull request

this is out of date. I've recently organized things to generate python through the Mako [PythonPrinter](https://bitbucket.org/zzzeek/alembic/src/9f5ebb1e53c3a65e98447ccf13750e9ea804a8d4/alembic/autogenerate/api.py?at=master#cl-159), which handles rudimental auto-indentation of Python code; I'd favor adding in a new style of PythonPrinter into Alembic that makes use of automated code formatting, such as [autopep8](https://pypi.python.org/pypi/autopep8/), perhaps as an optional plugin, or if we can invent something small-scale that works similarly just within the areas we need.

Closed by: ·2014-11-20

Description

By default Alembic generates autogenerated code that exceeds 80 character limit. With this patch, Alembic generates code with indentation and line breaks. For example:

Before:

op.create_index('ix_photo_album_management_history_reporter_to_media_id', 'photo_album_management_history', ['reporter_to_media_id'], unique=False)

After:

op.create_index( 'ix_photo_album_management_history_reporter_to_media_id', 'photo_album_management_history', ['reporter_to_media_id'], unique=False )

This saves me a lot of tedious formatting with every migration.

0 attachments

0 comments

Loading commits...