Skip to content

Conversation

@akheron
Copy link

@akheron akheron commented Aug 13, 2019

Looking at the code, this was always the intention, but there was a small bug in the logic that this PR fixes. Some tests needed to be updated, because they relied on the fact that even unchanged TOC was reported as transformed.

This is helpful e.g. to check in CI that all TOCs have been updated, like this:

doctoc --stdout . | grep -q "should be updated" && echo "TOCs are out of date!"

Looking at the code, this was always the intention, but there was a
small bug in the logic that this patch fixes.

This is helpful e.g. to check in CI that all TOCs have been updated,
like this:

    doctoc --stdout . | grep -q "should be updated" && echo "TOCs are out of date!"
@thlorenz
Copy link
Owner

thlorenz commented Jul 3, 2021

@AndrewSouthpaw this looks nice and assuming it doesn't break existing functionality we could merge that in and publish a major version upgrade.
What do you think?

And @akheron sorry for the multi-year delay on my part 😢

- [Multiple Backticks](#multiple-backticks)
- [code tag](#code-tag)
- [pre tag](#pre-tag)
Out of date
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we enhance the tests by comparing the generated TOC with expected content instead of using placeholders? The existing tests seem to simulate real scenarios, so perhaps we could extend that approach to verify that the file remains unchanged when the TOC is already up-to-date.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants