← Back to team overview

launchpad-dev team mailing list archive

Re: RFC: change from using lint to using a pretty printer

 

On Tue, Jun 14, 2011 at 8:51 PM, Julian Edwards
<julian.edwards@xxxxxxxxxxxxx> wrote:
> On Tuesday 14 June 2011 01:55:28 Robert Collins wrote:
>> Currently we get two (IMO) distinct benefits from running linters:
>>  * we find out about functional issues:
>>    - repeated definitions
>>    - unsafe constructs
>>  * We find out about cosmetic issues:
>>   - whitespace
>>   - indentation
>>
>> I think we get great value from the former, and limited if any value
>> from the second.
>
> I get good value from both, quite frankly, excepting the stupid warnings like
> the one about having a blank line at the end of the file.

Can you expand on the value you get? What does it do for you / us to
be told about whitespace and indentation variation?

>> So, I'd like to propose we do something other projects do: restrict
>> lint to reporting on functional issues, and use an idempotent pretty
>> printer to reformat our code automatically.
>>
>> We would add a post-commit hook in pqm that would reformat the changed
>> files using the pretty printer, and we'd no longer need to spend any
>> time thinking or worrying about formatting.
>>
>> What do you think?
>
> -1
>
> I don't trust pretty printers any further than I can throw 'em.  I also want
> to indent and format stuff as *I* like within the rules.

I've had very good experience with them on every project that got them
up and running (and smashed on a few times to sort teething-issues
out) in the past.

> As Gavin said, let's just suppress the useless warnings in the linter and
> carry on as we were.  I suspect most of us have pyflakes in our editors
> anyway, which means we get very few genuine bits of lint.

So, to me, just about all of the format-and-layout warnings are
useless: they don't make our code less buggy; my argument here is to
free our brains to focus on the stuff that matters; lower the bar for
casual contributors [by lowering the workload for all developers].
Many folk have internalised the rules, but many more haven't.

-Rob


Follow ups

References