Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: dart_style_todos #5091

Open
HosseinYousefi opened this issue Sep 6, 2024 · 2 comments
Open

proposal: dart_style_todos #5091

HosseinYousefi opened this issue Sep 6, 2024 · 2 comments
Labels
lint-proposal status-pending type-enhancement A request for a change that isn't a bug

Comments

@HosseinYousefi
Copy link
Member

dart_style_todos

Similar to flutter_style_todos but for repos in dart-lang org.

People could not longer be working on a project and taking the original context of the TODO with them. Enforcing to have an accompanying link that explains the issue in full detail helps eliminate this problem.

Links are better than GitHub issue numbers:

  • They are clickable from more editors than issue numbers.
  • Sometimes the issue is not on GitHub.
  • Links survive migrations to the other repos.

Description

Use Dart TODO format: // TODO(https://URL-to-issue): message.

Details

TODOs should include the string TODO in all caps, followed by the link to the respective issue in parenthesis.

Kind

Style

Bad Examples

// TODO: xyz.
// TODO(name): xyz.
// TODO(#123): xyz.

Good Examples

// TODO(https://github.com/dart-lang/linter/issues/123): xyz.

Discussion

dart-lang/native#1522

@devoncarew @mosuem @pq We could add this lint to https://github.com/dart-lang/lints to be consistent everywhere.

@lrhn
Copy link
Member

lrhn commented Sep 8, 2024

This is not a lint that should be in lints (aka. recommended and core lints). Those apply to every Dart author in the world. Not everyone has the same TODO strategy. Or have issue trackers at all that they can link to.

It's also a problem for the analyzer, when it does adds implementation for unimplemented methods, it also adds

  // TODO: implement <member-name>

That would the trigger the lint. (So, it would need a "TODO: Add URI to this TODO"!)

We could potentially want it in dart-flutter-team-lints, to be consistent inside out own code.
(A lint like this forces a single specific interpretation of "TODO" comments. If that's what a project wants, that's their choice. )

@HosseinYousefi
Copy link
Member Author

This is not a lint that should be in lints (aka. recommended and core lints). Those apply to every Dart author in the world.

Oops, yeah, I didn't mean this. Wrong repo.

We could potentially want it in dart-flutter-team-lints, to be consistent inside out own code.

I meant this -- potentially.

@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lint-proposal status-pending type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants