Skip to content
This repository was archived by the owner on Sep 16, 2022. It is now read-only.

Validate that code snippets in docs are at least "analyzer clean" #996

Closed
matanlurey opened this issue Mar 2, 2018 · 3 comments
Closed

Comments

@matanlurey
Copy link
Contributor

I believe (?) @chalin and others had a tool for this at one point.

Basically I'd have love to catch that:

const ClassProvider(Foo, ConcreteFoo);

... was an incorrect example (missing the useClass: named parameter).

Might not be worth doing, though.

@chalin
Copy link
Collaborator

chalin commented Mar 2, 2018

If this is related to #992, I was going to suggest that we integrate that page into site-webdev since we have there the necessary infrastructure allowing code excerpts to be analyzed and/or tested.

Actually, as @kwalrath mentioned already, it might be a good idea to have an Effective Angular section under site-webdev, similar to the Effective Dart section under dartlang.org.

FYI, regarding tooling, the Flutter site has some tooling to extract code excerpts and then analyze them. Under site-webdev, we use the usual tools to analyzer and test code. Instead we have a code excerpt extractor that scans the code, picks out fragments, and embeds the fragments into the docs. The approaches are complementary.

@matanlurey
Copy link
Contributor Author

matanlurey commented Mar 2, 2018

As mentioned elsewhere, I'd really like this to be in our own repository - and to figure out a syncing strategy. This stuff changes often, and the cognitive load of needing to land the CL separate to updating the best practices doesn't seem worth it.

@alorenzen
Copy link
Contributor

Also, if it is in our own repository, we can reference it easier internally as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants