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

☂ [Tracking] Restructure diagnostic message docs #4499

Open
MaryaBelanger opened this issue Jan 9, 2023 · 5 comments
Open

☂ [Tracking] Restructure diagnostic message docs #4499

MaryaBelanger opened this issue Jan 9, 2023 · 5 comments
Assignees
Labels
e2-days Can complete in < 5 days of normal, not dedicated, work e3-weeks Complete in < 4 weeks of normal, not dedicated, work from.team Reported by Dash docs team member meta.umbrella Collects multiple related issues p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. st.triage.ltw Indicates Lead Tech Writer has triaged t.cli-tools Relates to the dart command line tools t.diagnostics Relates to diagnostics, analysis, or linting of code
Milestone

Comments

@MaryaBelanger
Copy link
Contributor

MaryaBelanger commented Jan 9, 2023

There are a lot of small inconsistencies across the diagnostic messages documentation that altogether make the topic's content appear disjointed. For example,

  • The way lint messages are written varies slightly from message to message.
  • They differ completely from diagnostic messages, despite really just being two different types of the same thing.
  • Lints docs are built on two separate sites and tools link to each.
  • And other related maintenance issues.

Goal: Restructure the diagnostic message documentation to be more consistent, across messages, pages, and sites.

This issue is for planning/tracking. Most of the points can be addressed asynchronously. Some of the relevant content and the work described lives outside of this repo.

1. Consolidate linter rules with other diagnostic messages

Decision: TBD / Needs input

Issue: #4498

2. Consistent format and information across diagnostic messages

Decision: Rewrite individual linter rules to match diagnostic message format

Issue: dart-lang/linter#3924

The diagnostic messages have a more exact/succinct format to them than the lint messages, so we'll rewrite the lint messages to match that syntax.

This means using the structure of:

  • Single line summary
  • Description
  • Example
  • Common fixes (instead of GOOD/BAD)

Also need to standardize other features of lint messages not included in diagnostic messages:

  • How we link to Effective Dart
  • "This rule is available as of...."
  • "Rule sets:..."
  • "Quick fix available..."

@atsansone I know you had ideas about restructuring or standardizing the layout of individual messages, if you want to share here

3. Deprecate github.io/linter

Decision: repoint all the tools to dart.dev/tools/linter-rules and BE CAREFUL WITH REDIRECTS

Hosting the lint docs on github.io was decided before the linter rules were added to dart.dev. Now that they're on dart.dev (where they should be, to keep docs in one place), the io page should be deprecated.

A lot of tools point to the io pages though, so the redirects need to be dealt with very carefully.

4. Update how to enable lint instructions

Decision: page hasn't been reviewed in a while, make sure it's up to date

https://dart.dev/guides/language/analysis-options

5. Create guidance page for which lints to use

Decision: Add a page to the static analysis set of pages that provides guidance on which lints to enable for your needs

This will go into detail on the existing common lint sets, and maybe other use cases.

Recreate this page in dart.dev that groups lints by purpose: https://dart-lang.github.io/linter/lints/index.html

6. Standardize process for contributing lint messages

Decision: Document the exact format we decide on for linter rules, and a plan for how they are reviewed

Being addressed here:

Trial for reviewing in CLs: https://dart-review.googlesource.com/c/sdk/+/278640

7. Misc. improvements to diagnostic messages

Decision: pros and cons / benefit vs. cost of each of these needs further evaluation

Adding labels / icons / some other indicators to message docs that indicate things like:

  • Whether the lint has a quick fix (linter rules have it, diagnostic does not)
  • For lints, if it has any incompatible lints
  • If the lint belongs to a package/set, and if so, which one
  • What type of diagnostic it is (lint, error, warning)
  • Having a bug report per message in the docs, so users can report whether they found a lint helpful or it did what they expected

8. (Tangential) Consolidate type promotion error pages

Slightly related to diagnostic messages because some link to Type promotion failures page

Issue: #4393

9. (Tangential) Use the diagnostics glossary as a starting point for a standard site-wide glossary

The Glossary section on the Diagnostic messages page has a wealth of information that is really applicable to the site as a whole. We've discussed taking that content out and putting it on a new page (already created, https://dart.dev/resources/glossary). This would require all the links in the diagnostic and linter docs be updated to point to the same sections on the new page.

Issue: #4622


@bwilkerson @pq

@bwilkerson
Copy link
Member

  1. Consistent format and information across diagnostic messages

Single line summary

The existing diagnostic messages don't actually have a single line summary, what appears to be a summary is actually the message that's displayed to users in the IDE. We have it there to assure users that they've found the correct documentation.

I'll note, however, that the IDEs also display a correction message (when there is one; not all diagnostics have such a message), which isn't displayed on these pages. The reason it's not displayed is because it's usually a subset of the possible fix options discussed under "Common fixes".

  1. Standardize process for contributing lint messages

Trial for reviewing in CLs: https://dart-review.googlesource.com/c/sdk/+/278640

That particular CL is related to the non-lint diagnostic messages, though I suppose that the same process can, and should, be used for both kinds of messages.

  1. Misc. improvements to diagnostic messages

Whether the lint has a quick fix (linter rules have it, diagnostic does not)

That's not accurate. Many lints have quick fixes, but not all of them do, and non-lint diagnostics sometimes have quick fixes, though it's a smaller percentage than for lints.

@parlough parlough added p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. t.cli-tools Relates to the dart command line tools e2-days Can complete in < 5 days of normal, not dedicated, work e3-weeks Complete in < 4 weeks of normal, not dedicated, work analysis labels Jan 9, 2023
@parlough
Copy link
Member

parlough commented Jan 9, 2023

Wasn't sure which issue to post this in, but I continued a discussion on page length and multiple pages here: #4498 (comment)

Since it sounds like it is expected to mostly only visit diagnostic messages from tooling and IDEs, perhaps it doesn't make sense to have such a long page. We're already having users leave their workflow to visit a site and serving a bunch of information when they likely won't be manually scrolling for other diagnostics doesn't make a lot of sense.

I'm not too concerned about page clutter, especially since we could generate the diagnostic pages as part of the build process from some YAML or JSON structure. Perhaps we could even serve Markdown files too so IDEs could surface the documentation inline (are they capable of that?).

@MaryaBelanger
Copy link
Contributor Author

Thanks @bwilkerson, I'll update all these details up top.

That's not accurate. Many lints have quick fixes....

I think what I meant was the non-lint diagnostic message docs don't mention if they have a quick fix or not, but some of the lint docs do (is that accurate? quick ctrl+f "quick fix" on diagnostic-messages shows nothing). I'll update that at the top, thanks for pointing out.

That particular CL is related to the non-lint diagnostic messages...

I also think the same process should eventually be used for both. Like the format of the messages themselves, I think it makes sense to standardize work around the non-lint messages (already very standardized), and then integrate those practices into lint work (as much as possible with the more variant nature of lints)


@parlough I was expecting that conversation to be pretty active so I broke it out, but once a decision is reached I'll update up top with the conclusion. I think as work actually starts for each of these items, they'll probably all warrant their own issues!

@bwilkerson
Copy link
Member

I think what I meant was the non-lint diagnostic message docs don't mention if they have a quick fix or not, ...

That's correct.

... but some of the lint docs do ...

All of the lints that have a quick fix associated with them have a badge that indicates that fact. If there's no badge then it's because there's no fix. (The badges are programmatically added so that they can't be out of date.)

@atsansone atsansone added the t.diagnostics Relates to diagnostics, analysis, or linting of code label Apr 5, 2023
@atsansone
Copy link
Contributor

@atsansone atsansone added st.triage.ltw Indicates Lead Tech Writer has triaged meta.umbrella Collects multiple related issues labels May 9, 2023
parlough added a commit that referenced this issue Jun 27, 2023
This PR is meant to finalize work to make dart.dev a satisfactory
replacement for
[`dart-lang.github.io/linter/`](https://dart-lang.github.io/linter/)
while `dart-lang/linter` moves to the SDK and we work on consolidating
and improving documentation
(#4498).

It does this by (staged links after colon (`:`)):

- Updating the information on dart.dev/lints for the latest state of the
linter:
[/lints](https://dart-dev--pr4999-feature-linter-indiv-zetj76b0.web.app/tools/linter-rules)
- Making dart.dev/lints an index page rather than including all
information:
[/lints](https://dart-dev--pr4999-feature-linter-indiv-zetj76b0.web.app/tools/linter-rules)
- Moving the long-form lint rule documentation to individual pages found
at `dart.dev/lints/<rule>`:
[/lints/avoid_dynamic_calls](https://dart-dev--pr4999-feature-linter-indiv-zetj76b0.web.app/lints/avoid_dynamic_calls)
- It does this by using a Jekyll page generator based on
`linter_rules.json`.
- Adding a textual reference pointing to the recently released all
linter rules page
(38973de)
found at:
[/lints/all](https://dart-dev--pr4999-feature-linter-indiv-zetj76b0.web.app/lints/all)
- Updating and links and references for these previous changes (mostly
Effective Dart).

Contributes to dart-lang/linter#4460,
#4498,
#4499

**Note:** This is an intermediate step and doesn't aim to improve the
formatting or style of the information on the index or individual pages.
That will be part of follow-up work as we work on improvements to the
diagnostic linter rule documentation.
auto-submit bot pushed a commit to flutter/flutter that referenced this issue Jul 1, 2023
Removes the remaining links to the old linter site, to the guaranteed dart.dev/lints redirect.

Contributes to dart-lang/linter#4460 and dart-lang/site-www#4499
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Aug 4, 2023
Bug: dart-lang/linter#4460 and dart-lang/site-www#4499
Change-Id: Ieb90512aac4e476b922765c6ee191085a2ad2c9b
CoreLibraryReviewExempt: Only updates a link in documentation comments.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311880
Commit-Queue: Phil Quitslund <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Reviewed-by: Phil Quitslund <[email protected]>
@atsansone atsansone added the from.team Reported by Dash docs team member label Aug 8, 2023
@atsansone atsansone changed the title [Tracking] Restructure diagnostic message docs ☂ [Tracking] Restructure diagnostic message docs Aug 10, 2023
rmacnak-google pushed a commit to rmacnak-google/site-www that referenced this issue Sep 5, 2023
This PR is meant to finalize work to make dart.dev a satisfactory
replacement for
[`dart-lang.github.io/linter/`](https://dart-lang.github.io/linter/)
while `dart-lang/linter` moves to the SDK and we work on consolidating
and improving documentation
(dart-lang#4498).

It does this by (staged links after colon (`:`)):

- Updating the information on dart.dev/lints for the latest state of the
linter:
[/lints](https://dart-dev--pr4999-feature-linter-indiv-zetj76b0.web.app/tools/linter-rules)
- Making dart.dev/lints an index page rather than including all
information:
[/lints](https://dart-dev--pr4999-feature-linter-indiv-zetj76b0.web.app/tools/linter-rules)
- Moving the long-form lint rule documentation to individual pages found
at `dart.dev/lints/<rule>`:
[/lints/avoid_dynamic_calls](https://dart-dev--pr4999-feature-linter-indiv-zetj76b0.web.app/lints/avoid_dynamic_calls)
- It does this by using a Jekyll page generator based on
`linter_rules.json`.
- Adding a textual reference pointing to the recently released all
linter rules page
(dart-lang@38973de)
found at:
[/lints/all](https://dart-dev--pr4999-feature-linter-indiv-zetj76b0.web.app/lints/all)
- Updating and links and references for these previous changes (mostly
Effective Dart).

Contributes to dart-lang/linter#4460,
dart-lang#4498,
dart-lang#4499

**Note:** This is an intermediate step and doesn't aim to improve the
formatting or style of the information on the index or individual pages.
That will be part of follow-up work as we work on improvements to the
diagnostic linter rule documentation.
parlough added a commit that referenced this issue Aug 7, 2024
Lints no longer are part of three specific groups, but now have
tags/groups (dart-lang/linter#1020). This PR
removes the expectation of the three groups so that the lints keep
rendering. It also updates the source data to the latest version with no
groups.

As part of the work in
#4499, we'll surface the new
categories/tags later on :)

Closes dart-lang/sdk#56396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2-days Can complete in < 5 days of normal, not dedicated, work e3-weeks Complete in < 4 weeks of normal, not dedicated, work from.team Reported by Dash docs team member meta.umbrella Collects multiple related issues p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. st.triage.ltw Indicates Lead Tech Writer has triaged t.cli-tools Relates to the dart command line tools t.diagnostics Relates to diagnostics, analysis, or linting of code
Projects
None yet
Development

No branches or pull requests

4 participants