Commit Graph

13 Commits

Author SHA1 Message Date
Greg Spencer
2a42069b2a Bump snippets to 0.2.3, fix redundant global activate in docs.sh (#88123) 2021-08-12 17:37:05 -07:00
Greg Spencer
10e4b04010 Switch document generation to use the snippets package (#87231)
Switch document generation to use the snippets package instead of the snippets code in the Flutter repo. In the process, some bugs in sample code analysis have been fixed, and I've fixed some more errors in the samples.

This will allow the snippets package to be developed separately from the Flutter repo, and reduce the code in the Flutter repo.

The snippets code is deleted in this PR.

I also converted some comments in the snippet templates to be regular comments instead of doc comments, because having a doc comment block before the imports causes the Dart import sorter to lose the comment. They should have been regular comments in the first place.

The snippets package resides in the assets-for-api-docs repo.

The sample analysis has also been converted to be run in parallel, and I've bumped the Dartdoc version to 1.0.2.
2021-08-11 19:48:29 -07:00
Greg Spencer
169bb1b73f Fix the sample code analyzer to properly handle missing_identifier errors (#87593)
This fixes how the sample analyzer handles missing_identifier errors. It was looking at the wrong line, and missing an else clause, so it was silently allowing missing_identifier errors to pass.

In addition, this fixes the sample generation so that it uses the correct filename for the output files: it previously was looking for the first line that had a filename, which was meant to indicate a non-generated line. This change adds a new Line.generated constructor for generated lines, so that they can also have the correct filename associated with them.
2021-08-03 17:39:12 -07:00
Greg Spencer
bf1fb6e84b Switch sample analysis over to use package:flutter_lints (#84303)
This switches the sample analysis code to use package:flutter_lints instead of the flutter repo analysis options, so that they are compatible with a similar change to DartPad.
2021-06-09 18:09:14 -07:00
Sam Rawlins
b2ed8a25b5 Ignore unnecessary_import reports in sample code (#84125) 2021-06-07 12:14:06 -07:00
nt4f04uNd
80a2b6b015 Fix typos (#82589) 2021-05-20 17:19:09 -07:00
Greg Spencer
59b406c760 Sort imports when interpolating sample templates (#81873) 2021-05-07 15:34:04 -07:00
Greg Spencer
ea9d9ee9fd Turn off directives_ordering lint when analyzing samples (#81698)
This turns off the "directives_ordering" lint when analyzing samples, since it's indeterminate what the ordering will be, given that samples derive their imports both from the template and the example code.

This is temporary to avoid broken builds, but the correct solution is to reorder the output so that the imports are ordered properly so that we give the proper example for our users.
2021-05-03 13:41:29 -07:00
Greg Spencer
7bff366b96 Convert snippets tool to null safety (#78646) 2021-04-29 22:34:04 -07:00
Phil Quitslund
1105c8b956 ignore directives ordering in generated code (#81017) 2021-04-22 21:24:02 -07:00
Greg Spencer
b33c7891c1 Fix the sample analyzer to analyze dart:ui and make the analyzer null safe (#80742) 2021-04-22 12:14:02 -07:00
Greg Spencer
a8d820a46e Update samples to use repo analysis options, Fix sample templates and a ton of analyzer issues (#77868) 2021-03-11 16:45:03 -08:00
Michael Goderbauer
7e017d318e Enable file_names and package_names lints (#77087) 2021-03-02 15:24:04 -08:00