-
Notifications
You must be signed in to change notification settings - Fork 183
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
Check docs links after building #2024
Check docs links after building #2024
Conversation
Target( | ||
"generate-docs", | ||
() => Run("python", "-m mkdocs build --clean --site-dir artifacts/docs --config-file mkdocs.yml --strict")); | ||
|
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 waffled over how to structure the targets.
Coulda been one big target: build and check.
Coulda been 3 targets: docs that depends on check-docs-links that depends on generate-docs
Coulda been 3 targets: docs that depends on both generate-docs and check-docs-links (with checks-docs-links depending on nothing)
I went this way but would go another way!
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 think I prefer this one:
3 targets: docs that depends on check-docs-links that depends on generate-docs
It's a bit strange that the docs
target actually does the check
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.
Thanks @blairconrad, nice work as usual! I have some minor comments
tools/FakeItEasy.Build/Program.cs
Outdated
// If mkdocs's site_url configuration is not set, sitemap.xml is full of "None" links. | ||
// Even with a valid site_url, the link check would fail if we added a new page. | ||
// So trust that sitemap.xml will be generated correctly. | ||
// The 404.html page is likewise generated, and isn't even the one we use on the live site (mike generates a new one). |
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'm confused by this comment. If I understand correctly, because site_url is not set, the sitemap.xml is not generated correctly. But then you say that we "trust that sitemap.xml is generated correctly"?
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.
Fair point.
// If mkdocs's site_url configuration is not set, sitemap.xml is full of "None" links.
// Even with a valid site_url, the link check would fail if we added a new page.
// So trust that any non-None links that mkdocs puts in sitemap.xml will be valid.
// The 404.html page is likewise generated, and isn't even the one we use on the live site (mike generates a new one).
?
tools/FakeItEasy.Build/Program.cs
Outdated
Target( | ||
"docs", | ||
DependsOn("generate-docs"), | ||
() => Run("linkchecker", "--ignore-url=sitemap.xml --ignore-url=404.html --check-extern -F html/./artifacts/docs-link-check.html ./artifacts/docs/index.html")); |
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.
What does the -F
option do? Path of the report? Why /./
?
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.
Format and path of the report. The /./
is probably there because, I dunno. I got the filename via path completion in the shell and left it. Removing.
-F TYPE[/ENCODING[/FILENAME]], --file-output TYPE[/ENCODING[/FILENAME]]
wrap each of the following lines to match the length of the first one
Output to a file linkchecker-out.TYPE, $XDG_DATA_HOME/linkchecker/failures for 'failures' output,
or FILENAME if specified. The ENCODING specifies the output encoding, the default is that of your
locale. Valid encodings are listed at https://docs.python.org/library/codecs.html#standard-encodings.
The FILENAME and ENCODING parts of the 'none' output type will be ignored, else if the file already
exists, it will be overwritten. You can specify this option more than once.
Valid file output types are 'csv', 'xml', 'dot', 'failures', 'gml', 'gxml', 'html', 'none',
'sitemap', 'sql', 'text'. You can specify this option multiple times to output to more than one file.
Default is no file output. Note that you can suppress all console output with the option '-o none'.
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.
Where is ENCODING
? You just did TYPE/FILENAME
, is that valid? How does it know whether it's the encoding or the filename?
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.
It seems to be valid. I dunno. It sussed it out. I'll add an encoding.
Target( | ||
"generate-docs", | ||
() => Run("python", "-m mkdocs build --clean --site-dir artifacts/docs --config-file mkdocs.yml --strict")); | ||
|
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 think I prefer this one:
3 targets: docs that depends on check-docs-links that depends on generate-docs
It's a bit strange that the docs
target actually does the check
5ba6189
to
21e921c
Compare
Thanks for comments, @thomaslevesque. Hopefully resolved. If not, do tell me! Rebased. All commits but the last applied cleanly, and it contains changes to address your comments. |
Late-breaking update. Upgraded the documentation dependencies to go along with our new requirement. 'sides, there's a new requests since you merged dependabot's PR yesternight. Can drop if you like. |
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, thanks @blairconrad!
9c38247
to
52acf15
Compare
Thanks, @thomaslevesque. |
This change has been released as part of FakeItEasy 8.3.0. |
No description provided.