packages icon indicating copy to clipboard operation
packages copied to clipboard

Remove `no_adjacent_strings_in_list` from enabled lint rules.

Open srawlins opened this issue 1 year ago • 7 comments
trafficstars

no_adjacent_strings_in_list conflicts with another rule, prefer_adjacent_string_concatenation. I suggest removing the former.

See https://github.com/dart-lang/sdk/issues/59041

prefer_adjacent_string_concatenation is a style-oriented rule, but it is in the package:lints recommended set. So... it is recommended.

no_adjacent_strings_in_list is an error-preventing lint rule, but it's usefulness is waning, as the new style of the Dart formatter will always split adjacent strings into new lines.

We are marking these two lint rules as incompatible. If the fix in this PR is not desired, there are two other options:

  • Remove prefer_adjacent_string_concatenation from the enabled lint rules.
  • Insert an # ignore: comment in the top-level analysis options file, and an # ignore: included_file_warning comment in any files that include the top-level one.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

srawlins avatar Oct 15 '24 20:10 srawlins

We should comment this out with an explanation, as with most other lints we don't use use (see the rest of the file), rather than removing it.

It's unfortunate that we're having to turn off a useful warning before we get the formatter change that would make the mistake the warning would catch obvious though.

stuartmorgan-g avatar Oct 17 '24 09:10 stuartmorgan-g

I'll convert to draft for a bit.

srawlins avatar Oct 17 '24 14:10 srawlins

I'll convert to draft for a bit.

If we are waiting for the new formatter first, this will need to be Draft until all of our packages require Dart 3.7, right?

stuartmorgan-g avatar Dec 03 '24 20:12 stuartmorgan-g

Sure.

srawlins avatar Dec 03 '24 23:12 srawlins

(triage): Talked to @srawlins and he says this is still on his radar.

goderbauer avatar Feb 11 '25 23:02 goderbauer

(triage): Talked to @srawlins and he says this is still on his radar.

Howdy, checking in from triage again. @srawlins is this still on your radar?

Piinks avatar Apr 18 '25 21:04 Piinks

Still on my radar. Waiting for minimum package versions to be >= 3.7.0.

srawlins avatar Apr 18 '25 21:04 srawlins

Waiting for minimum package versions to be >= 3.7.0.

Is this condition now satisfied? :)

Piinks avatar Jul 08 '25 22:07 Piinks

Nope, the first package I checked is still 3.6.0. https://github.com/flutter/packages/blob/main/packages/animations/pubspec.yaml

srawlins avatar Jul 08 '25 23:07 srawlins

The only automatic roll-forward of min SDK versions is that after each stable we update any package that supports a version of Flutter/Dart older than the N-2 stable Flutter version to require N-2 (since we don't run analysis in CI of anything older than N-2, so wouldn't find breakage).

So in the normal course of business, this would be landable after the next Flutter stable release. If there's a strong desire to land this before then, it would be fine to mass-update everything to require N-1 right now, as there's no requirement to support anything older than current stable.

stuartmorgan-g avatar Jul 09 '25 11:07 stuartmorgan-g

Everything in the repo is now using the new formatter (except for the repo tooling, but that's fine), so we can land this now.

stuartmorgan-g avatar Aug 19 '25 18:08 stuartmorgan-g

We should comment this out with an explanation, as with most other lints we don't use use (see the rest of the file), rather than removing it.

This still needs to be addressed, then this can land.

stuartmorgan-g avatar Aug 19 '25 18:08 stuartmorgan-g

Greetings from stale PR triage! 👋 Is this change still on your radar?

Piinks avatar Oct 20 '25 21:10 Piinks

Yes I'll try to get back to this.

srawlins avatar Oct 20 '25 22:10 srawlins

OK this is ready for review.

srawlins avatar Oct 21 '25 03:10 srawlins