Re: Friday Fun

2014-07-15 Thread Wayne Witzel
Yeah, I use it along side of sortimports. Looking at the source for goimports, I think it would be a clean entry point to add sorting to it. I imagine a pull request of that nature would be well received by the project. On Tue, Jul 15, 2014 at 9:19 AM, roger peppe wrote: > Although goimports is

Re: Friday Fun

2014-07-15 Thread roger peppe
Although goimports is a great tool (I use it all the time) it doesn't implement the same import grouping rules that we use, or change any existing groups. I'm tempted to submit a change to it that does that, but I don't know how well it would be received. On 15 July 2014 13:20, Wayne Witzel wrot

Re: Friday Fun

2014-07-15 Thread Wayne Witzel
Along the same lines, I've been using goimports ( https://github.com/bradfitz/goimports). Micheal pointed to it. It wraps go fmt and supports the same flags, but also adds a layer that removes and adds imports that are unused or needed respectively. I've had good luck with it running on save with

Fwd: Friday Fun

2014-07-11 Thread roger peppe
That's funny - I also have a little Go program that does the same thing. I call it "sortimports", and it actually does the sorting rather than just reporting that they're not sorted correctly. http://paste.ubuntu.com/7778940/ I haven't published it because it doesn't *always* work in the presence

Re: Friday Fun

2014-07-11 Thread Andrew Wilkins
On Fri, Jul 11, 2014 at 1:19 AM, Jesse Meek wrote: > I polished off a script this afternoon to check that imports are group > correctly. It deals with comments, if the groups are in the wrong order, if > there are too many groups and several other edge cases. I *think* I don't > have any false p

Re: Friday Fun

2014-07-11 Thread roger peppe
That's funny - I also have a little Go program that does the same thing. I call it "sortimports", and it actually does the sorting rather than just reporting that they're not sorted correctly. http://paste.ubuntu.com/7778940/ I haven't published it because it doesn't *always* work in the presence

Friday Fun

2014-07-10 Thread Jesse Meek
I polished off a script this afternoon to check that imports are group correctly. It deals with comments, if the groups are in the wrong order, if there are too many groups and several other edge cases. I *think* I don't have any false positives. Here is the output: http://pastebin.ubuntu.com/