Linter: Update lint docs to call out associated Effective Dart rules

Created on 14 Jun 2018  路  11Comments  路  Source: dart-lang/linter

Some were done, others weren't. New rules have come and some links have been updated. Net-net: it'd be great to do an audit and cleanup.

See also: https://github.com/dart-lang/site-www/issues/921

docs enhancement help wanted

Most helpful comment

have a script to automatically copy description/details from the site to the linter description.

That seems like a bad idea. The comments reflect what the lint is actually doing, rather than what the style guide says ought to happen. If we had a tool to identify when the two diverge then we'd have an easy way to track changes to the guide, but I don't know that it's worth doing. But we definitely shouldn't auto update the description so that the description doesn't match the code.

All 11 comments

I started to have a look yesterday and PRs will come :)

I have concerns about how to keep lint description/details up to date with the description of the style guide ? Should we:

  • copy/paste manually
  • only have a link from lint description to site
  • have a script to automatically copy description/details from the site to the linter description.

I like the last option. I will try to prototype it.

  • have a script to automatically copy description/details from the site to the linter description. I like the last option.

I will try to prototype it.

After looking at some rules I'm not sure it's a good idea.

For a while now I've been thinking about how to use our code excerpt tooling to automate doc updates like these. If you might be interested, let me know and I'll provide you with details.

@chalin: yes please! I'd be very curious for details.

Can you give me an example of the kind of description/details that you'd like to extract?

It could be fine to replace desc and details with the content of the site (without the note section and with some transformations for GOOD/BAD sections)

have a script to automatically copy description/details from the site to the linter description.

That seems like a bad idea. The comments reflect what the lint is actually doing, rather than what the style guide says ought to happen. If we had a tool to identify when the two diverge then we'd have an easy way to track changes to the guide, but I don't know that it's worth doing. But we definitely shouldn't auto update the description so that the description doesn't match the code.

That works for me. So we're going with a one-way correspondence from the Effective Dart page(s), referring to appropriate lint rule(s)?

That works for me. So we're going with a one-way correspondence from the Effective Dart page(s), referring to appropriate lint rule(s)?

Lint rules derived from Effective Dart should point back to it too. (For attribution and added context.)

https://github.com/dart-lang/site-www/issues/921 implements the other direction (links from the Effective Dart docs). Cheers @kwalrath ! 馃

Next up there's talk of capturing these associations in a separate file that we can process to generate back links in the linter docs...

Was this page helpful?
0 / 5 - 0 ratings