pub-dev icon indicating copy to clipboard operation
pub-dev copied to clipboard

Support different line lengths

Open vaind opened this issue 5 years ago • 3 comments

It would be nice if you could support different line lengths, e.g. -l 120 parameter to pana. While 80 is a recommended dartfmt default, some projects don't want to use that and instead opt for a different number.

Currently, it's reported as a "Health suggestion" on the package analysis tab:

Health suggestions

Format path/to/file.dart. Run dartfmt to format path/to/file.dart.


I don't think it's a project health issue as long as the whole project is consistent with the formatting, albeit with a different line length than the default 80. While I understand these suggestions have no negative impact on the score I'd still prefer them not to show up on the page at all.

Is there something that can be done about it? Maybe some simple configuration file or a config in the pub.dev admin section?

vaind avatar Nov 18 '19 13:11 vaind

I don't think we can or should do anything in the short term. But this is solid input for the debate about what lints we should use to score packages.

jonasfj avatar Nov 18 '19 19:11 jonasfj

I don't think we can or should do anything in the short term. But this is solid input for the debate about what lints we should use to score packages.

I think this is not something hard to complete, the simplest way is just ignore length check, I think it should be done as soon as possible. As for rule of score, I agree with it as long term topic. As I know source code of flutter not follow 80 characters per line. And allow for different length will provide great develop experience and code readability.

techwn avatar Jan 07 '24 08:01 techwn

Allow us to have some max-lines attribute in the pubspec.yaml... fetch that on your score calculator.

alexmercerind avatar Sep 22 '24 20:09 alexmercerind