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

Make auto generated script flake8 (PEP 8) compliant #393

Closed
sqlalchemy-bot opened this Issue Oct 28, 2016 · 9 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Oct 28, 2016

Migrated issue, originally created by Gasper Vozel (@karantan)

So autogenerate option is awesome (--auto) but it generates a script with a bunch of flake8 errors and you always need to manually fix the same things like breaking lines, fixing indents, etc.

See the attachment for screenshot.

So lets fix this and save a ton of time on the long run.


Attachments: [Screenshot 2016-10-28 14.39.50.png](../wiki/imported_issue_attachments/393/Screenshot 2016-10-28 14.39.50.png)

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Oct 28, 2016

Michael Bayer (@zzzeek) wrote:

looks like you've forked. dont know how you're going to do the long lines, every long line automator I've ever tried does an awful job.

IMO I'd rather stick a .flake8 file or something in the directory and just be done with it. A lot of their rules I disagree with anyway (though they might not apply to alembic migration files).

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Oct 28, 2016

Nejc Zupan (@zupo) wrote:

I suggest leaving long-lines as they are, since the line length is usually the most controversial.

That said, I am +1 for "fixing" idents.

Or, we can always make it extendable, so one can provide custom code that formats it arbitrarily.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Oct 28, 2016

Michael Bayer (@zzzeek) wrote:

OK so you'd still get flake8 warnings then. If we just want to reduce the obvious flake8s, that's fine.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Oct 28, 2016

Michael Bayer (@zzzeek) wrote:

though your screenshot looks like its all indentation. indentation automators too, seem to do a horrible job as far as I've seen though havent looked in a few years.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Nov 4, 2016

Daniel Bengtsson (@Zitrax) wrote:

What shows in a simple generated file with no commands are:

  • 1x "PEP 8: expected two blank lines, found 1"
  • 4x "PEP 8: too many leading '#' for block comment"

would indeed be nice to fix those.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Nov 23, 2016

Michael Bayer (@zzzeek) wrote:

Duplicate of #307.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Nov 23, 2016

Changes by Michael Bayer (@zzzeek):

  • added labels: duplicate
  • changed status to closed
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Nov 28, 2016

Michael Bayer (@zzzeek) wrote:

Add single pound to generated comments

Adjustment to the "please adjust!" comment in the script.py.mako
template so that the generated comment starts with a single pound
sign, appeasing flake8.

Change-Id: I4b425d2fa8701cabf8352d046b3342a73f78c70d
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/65
Partially-fixes: #393

5b97778

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Nov 28, 2016

Changes by Michael Bayer (@zzzeek):

  • removed labels: duplicate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment