← Back to team overview

launchpad-dev team mailing list archive

Re: New coding standard for formatting imports

 

Am 18.08.2010 16:26, schrieb Brad Crittenden:
> Henning Eggers will be writing a tool to reformat imports and will do it all at once.  Until then reviewers will not be enforcing the policy.
> 

It is done.

In devel r11407 and db-devel r9682 all the import statements in
dev/canonical/launchpad an dev/lp have been reformatted to conform to the new
style. If you have any branches in progress, please remember to merge
(db-)devel before submitting to PQM and expect conflicts in the import
sections of your .py files.

I wrote and used the format-imports script to convert the files and made sure
that no file needed manual fixing after the script was run. This way it can be
re-run any time to make sure that new code conforms to the coding standard. It
can be found at lp:~henninge/+junk/format-imports and takes the file or
directory names you wish to reformat as a parameter.

I intend to write more about the challenges I faced with the reformatting and
what the script does and what not, but not now.

This means that as of now reviewers are asked to enforce the new style in code
reviews. The style is pretty easy to follow if the script is used. Since  it's
my review shift on Monday, I am happy to help out where needed.

Cheers,
Henning



Follow ups

References