Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Conversation

@srawlins
Copy link
Contributor

@srawlins srawlins commented Oct 3, 2022

Description

New rule! no_adjacent_strings_in_collection, an alternative to #2726, and a replacement for no_adjacent_strings_in_list. Improvements (differences) include:

  • works on set literals
  • works on collection for-elements
  • works on collection if-elements

Fixes dart-lang/sdk#58273 and fixes dart-lang/sdk#58437

@coveralls
Copy link

coveralls commented Oct 3, 2022

Coverage Status

Coverage increased (+0.01%) to 95.724% when pulling 4a3618c on no-adjacent-strings-in-collection into e5a079a on main.

@bwilkerson
Copy link
Contributor

I think that we want to be very conservative about adding new lint rules at this point. Given that there's a discussion about whether we're going to keep adjacent strings, I wonder whether it might not be better to wait on adding more lints around them until a decision has been made. I'd hate to add a new lint and then deprecate it a couple of months later.

Also, given that no_adjacent_strings_in_list isn't in the core or recommended lint sets, it might be appropriate to just extend that rule to cover the set case.

WDYT?

@srawlins
Copy link
Contributor Author

srawlins commented Oct 3, 2022

I'd hate to add a new lint and then deprecate it a couple of months later.

I don't think "no adjacent strings" is on the table for Dart 3.0, so it will be at least a year, and more like 5? Right?

Also, given that no_adjacent_strings_in_list isn't in the core or recommended lint sets, it might be appropriate to just extend that rule to cover the set case.

I love it. We can land #2726 #3741 instead of this. The lint rule name would stay the same though; it would say in_list even though it guarded set literals too.

@bwilkerson
Copy link
Contributor

I don't think "no adjacent strings" is on the table for Dart 3.0 ...

I have no idea what timeframe they're thinking about, even assuming that they decide to remove it (which isn't at all clear to me either). I just thought it might be good to give the discussion a few days to see whether a decision is made or whether they stall out.

The lint rule name would stay the same though ...

I've wondered a few times whether we might want some kind of 'alias' feature for lints so that we could more easily rename them. We decided a long time ago to not use "do", "don't", "prefer", etc. in lint names, but we don't have a good way to go back and clean up the older lints to follow the newer naming conventions.

Not sure we have time to add such a feature right now, but it would support this renaming as well.

@srawlins
Copy link
Contributor Author

srawlins commented Jan 3, 2023

Replaced by #3741

@srawlins srawlins closed this Jan 3, 2023
@srawlins srawlins deleted the no-adjacent-strings-in-collection branch January 3, 2023 18:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants