← Back to team overview

launchpad-dev team mailing list archive

Re: New coding standard for formatting imports

 

On 19 August 2010 15:56, Maris Fogels <maris.fogels@xxxxxxxxxxxxx> wrote:
> Since Henning's script sorts the imports for you, one could write a macro
> where you type "from foo.bar import Bar", the editor jumps to the top of the
> file, spits what you typed out anywhere in the header it likes, then runs
> format-imports.  Henning's script will both group and sort the new import
> line for you.  You don't even have to go to the top of the file to look.

On that note, I've updated the sort-imports function at
https://dev.launchpad.net/EmacsTips to conform to the new policy.
sort-imports is not - and never has been - as all-singing and
all-dancing as the Maris's description, but I find it very useful.



References