-
Notifications
You must be signed in to change notification settings - Fork 700
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
Analyze/test analysis-options page code excerpts #1912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! I have a few small comments.
I'd like an engineer (@filiph or @johnpryan) to look at these changes, too, since they involve more code than I'm comfortable reviewing.
|
||
Here's a sample analysis options file: | ||
|
||
{% prettify yaml %} | ||
<?code-excerpt "analysis_options.yaml" from="include" remove="implicit-dynamic" retain="/^$|\w+:|- camel/" remove="http:"?> | ||
```yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting... the formatting for yaml got much less vibrant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Markdown code blocks are processed statically and rendered using the highlight
package styles (as opposed to the prettifier JS package). I haven't yet tweaked highlight
package styles in support of YAML. If you agree that this isn't gating, I'd suggest addressing it in a followup PR (though, if I have time before Filip or John review it, I ca add the style changes to this PR too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not gating. I'd noticed the difference in styles for awhile, but it's starting to annoy me more and more. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Followup issue: #1918
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed by #1924
{:.console-output} | ||
<?code-excerpt "analysis/analyzer-results.txt" retain="empty_statements" replace="/ at (lib|test)\/\w+\.dart:\d+:\d+/ at \/*1*\//g"?> | ||
```nocode | ||
lint • Avoid empty statements at /*1*/ • empty_statements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part seems weird to me... you'd never see comment text (/*1*/
) in there. Can we be more realistic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll see if I can think of something. I have an idea; I'll try it out tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added line numbers and dash-underlined in red just like, say, VS Code does. Let me know if that works for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates done and staging server refreshed. PTAL @kwalrath
f2053fd
to
47fdec7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@kwalrath - I justed added the IDE-like analyzer-error highlighting to the implicit-casts example too. PTAL. It is in a separate commit, so I can easily take it out if you don't like it. Here is what the error highlighting looks like for the two opening examples: And here is what it looks like for the implicit-casts example: |
Looks great! Feel free to squash and merge this. (I didn't because I wasn't sure if the order of these commits was important.) |
Resolves the second item of #1803.
Staged at https://dart-dev-staging-1.firebaseapp.com/guides/language/analysis-options
Original https://dart.dev/guides/language/analysis-options
I've checked external links:
The broken links are due to the fact that the analyzer documentation generation failed for the latest release: