Skip to content

Conversation

@dacharyc
Copy link
Collaborator

This is a new audit-cli tool that can help us:

  • Traverse files in a start dir or filepath
    • Optionally, recurse through child dirs and/or separately follow include filepaths
  • Extract the contents of code example directives (literalinclude, code-block, and io-code-block) to new files on the file system
  • Search the contents of a file (or optionally, recurse through a directory) for a specific substring

This lets us do things like:

  • Start from the Install MongoDB Community docs page source (on file system), find all the files that compose this source, extract all the code examples from those files, and find code examples with specific patterns that we may want to test or update

I've tried to write it with an extensible architecture so we can grow the commands as we figure out more use cases.

Copy link
Collaborator

@cbullinger cbullinger left a comment

Choose a reason for hiding this comment

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

non-blocking questions and comments. this seems like a really useful tool! 🎉

@@ -0,0 +1 @@
audit-cli
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we want to ignore any generated output?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The tool doesn't generate any output in any specific directory that can be ignored. If you're generating output, you need to specify a filepath for the generated output. So there aren't any specific patterns to add to the gitignore at this time.


Compare file contents to identify differences between files. Supports two modes:
1. **Direct comparison** - Compare two specific files
2. **Version comparison** - Compare the same file across multiple documentation versions
Copy link
Collaborator

Choose a reason for hiding this comment

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

cool!

@cbullinger cbullinger merged commit 4df6358 into mongodb:main Oct 23, 2025
1 check passed
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.

2 participants