Relaxing closure linter's line length restriction?

826 views
Skip to first unread message

Michael Lehenbauer

unread,
Jan 26, 2012, 3:27:26 PM1/26/12
to Closure Linter Discuss
My understanding is that the closure linter hardcodes an 80-character
line length restriction. I see there has been some attempt (http://
code.google.com/p/closure-linter/issues/detail?id=16) by the community
to disable this or make it configurable. I'd love to get such a
change pushed through into the mainline sources. Can anybody comment
on what kind of change would likely be accepted?

I don't mind adjusting my style to get the benefit of the linter, but
I like using descriptive names, so I'm finding that wrapping at 80-
columns creates a lot of awkward wrapped statements. And I can fit 3
80-column editors on a 1920x1080 monitor; I'd really like to use that
real-estate better. :-)

The --ignore_errors code review associated with issue 16 was created
almost a year ago. Is there some improvement that would make it
likely to be accepted? Or a different approach? I can hardcode a
different version for my own uses, but I'd rather not fork the code.

Thanks!
-Michael

Andy Perelson

unread,
Jan 26, 2012, 6:24:42 PM1/26/12
to closure-lin...@googlegroups.com
The Closure Linter is primarily concerned with enforcing the Google Style Guide, and we use it internally for just that. For Googlers, it is not optional. The JS line length is 80 and it should not be exceeded (there are some exceptions such as urls that the linter does support). So, internally, we actively don't want the feature of a configurable line length, or the ability to suppress any errors. They would allow us to ignore our own style guide.

Thus to implement this, we need to implement it in such a way that we allow external users of the Closure Linter can configure max line length, potentially turn off errors, etc. but we don't want to allow this internally. It's doable (we have at least one such feature already) but unfortunately means its low priority for us since it's an ask for a feature we can never use. It's not easy for anyone externally to contribute a patch that fully satisfies the differing internal / external requirements (which is the harder part of the feature).

I hear you guys, and I see the value of what you're asking. I'd love for the Closure Linter to really support the use cases of our entire community. But I personally haven't had the time to make this happen, and I don't know of anyone else who has. If we can find someone in Google who can see the whole system and is willing to make the change, I think it would be a fine one linter.

Thanks,

Andy
Reply all
Reply to author
Forward
0 new messages