fluentassertions / fluentassertions.analyzers

Analyzers based on the FluentAssertions best practices docs
https://www.fluentassertions.com/tips
MIT License
136 stars 21 forks source link

docs: generate documentation #307

Closed Meir017 closed 6 months ago

Meir017 commented 6 months ago

resolves #274

example of generated docs:

image

Meir017 commented 6 months ago

@jnyrup / @dennisdoomen I'd love to get your feedback on this approach maybe a similar approach could be used to generate https://github.com/fluentassertions/fluentassertions/blob/develop/docs/_pages/collections.md and the other assertion examples

dennisdoomen commented 6 months ago

That's pretty cool. But I wonder how we would integrate it into the website.

Meir017 commented 6 months ago

@dennisdoomen a comment-line program that parses the source code could be executed as part of the website generation (the collections.md file could be generated from multiple tests that compile and pass)

dennisdoomen commented 6 months ago

But that would require us to take control of the website generation process that GitHub now takes care off. We have no plans to do that unless somebody else takes the work from our plate.

Meir017 commented 6 months ago

@dennisdoomen I thought that the docs website is generated using the docfx tool, and then adding a dotnet command to build a different project before building the docs would be simple enough.

If I understand correctly jekyll is used to generate the docs site (here https://github.com/fluentassertions/fluentassertions/blob/develop/docs/.travis.yml)

dennisdoomen commented 6 months ago

Yeah, it's a Jekyll site, but the deploy process is completely handled by GHA. Unless somebody is willing to change that (I don't have the time), your suggestion is not going to be possible.

Meir017 commented 4 months ago

FYI @dennisdoomen / @jnyrup I'm now able to generate the failure messages as well https://github.com/fluentassertions/fluentassertions.analyzers/blob/main/docs/MsTestAnalyzer.md#scenario-booleanassertistrue I think this approach will be more reliable than what we have in https://fluentassertions.com/tips/#assert (already out of sync as the subject is now being printed in the error message image for the fluentassertion we should print "Expected actual to be true, but found False.")

dennisdoomen commented 4 months ago

Looks great. What do you have in mind with this?