Skip to content

✨ feat: extract mq-check and mq-docs into standalone crates#1262

Merged
harehare merged 6 commits intomainfrom
feat/extract-check-and-docs-crates
Feb 11, 2026
Merged

✨ feat: extract mq-check and mq-docs into standalone crates#1262
harehare merged 6 commits intomainfrom
feat/extract-check-and-docs-crates

Conversation

@harehare
Copy link
Copy Markdown
Owner

Extract the check and docs subcommands from mq-run into dedicated crates (mq-check and mq-docs).

Extract the `check` and `docs` subcommands from mq-run into dedicated
crates (mq-check and mq-docs) for better modularity and independent
usage. The mq-docs crate also adds HTML output format with sidebar
navigation and search filtering.
Copilot AI review requested due to automatic review settings February 11, 2026 06:14
Copy link
Copy Markdown
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.

Pull request overview

Extracts the check and docs subcommands from mq-run into standalone crates (mq-check and mq-docs) and updates workspace wiring accordingly.

Changes:

  • Removed Docs/Check subcommands (and related logic/tests) from crates/mq-run.
  • Added new mq-check and mq-docs crates with binaries and reusable library functions.
  • Updated workspace members/dependencies and enabled additional mq-lang features for mq-hir.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
crates/mq-run/src/cli.rs Removes in-CLI docs/check implementations and their unit tests.
crates/mq-hir/Cargo.toml Enables mq-lang file-io feature (likely to support file-backed parsing/URLs).
crates/mq-docs/src/main.rs Adds mq-docs CLI entrypoint (parsing args, reading files, printing output).
crates/mq-docs/src/lib.rs Implements docs generation in Markdown/Text/HTML formats.
crates/mq-docs/Cargo.toml Introduces the mq-docs crate and binary target.
crates/mq-check/src/main.rs Adds mq-check CLI entrypoint.
crates/mq-check/src/lib.rs Implements file checking logic previously in mq-run.
crates/mq-check/Cargo.toml Introduces the mq-check crate and binary target.
Cargo.toml Adds new crates to the workspace and workspace dependencies.

for (filename, content) in file_contents {
let mut hir = mq_hir::Hir::default();
hir.builtin.disabled = true;
let url = Url::parse(&format!("file:///{filename}")).ok();
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Building a file URL via string formatting + Url::parse is not robust (e.g., Windows paths, backslashes, spaces/non-ASCII requiring percent-encoding). This may cause URL parsing to fail and silently drop file context (url becomes None). Prefer Url::from_file_path(...) (and consider passing PathBuf through the API instead of a pre-rendered String).

Suggested change
let url = Url::parse(&format!("file:///{filename}")).ok();
let url = Url::from_file_path(filename).ok();

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 11, 2026 06:37
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.

Copilot AI review requested due to automatic review settings February 11, 2026 12:48
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 22 out of 24 changed files in this pull request and generated 10 comments.

Copilot AI review requested due to automatic review settings February 11, 2026 13:24
Copy link
Copy Markdown
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.

Pull request overview

Copilot reviewed 25 out of 27 changed files in this pull request and generated 4 comments.

use mq_lang::DefaultEngine;
use rayon::prelude::*;
use std::collections::VecDeque;
use std::io::BufRead;
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The unused import std::collections::VecDeque was removed on line 8, but line 9 now shows use std::io::BufRead; which may also be unused after removing the check and docs commands. Verify that BufRead is still used elsewhere in the file.

Suggested change
use std::io::BufRead;

Copilot uses AI. Check for mistakes.
for (filename, content) in file_contents {
let mut hir = mq_hir::Hir::default();
hir.builtin.disabled = true;
let url = Url::parse(&format!("file:///{filename}")).ok();
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The URL construction uses three slashes (file:///) which is valid for absolute paths but may fail for relative paths or paths on Windows. Consider using Url::from_file_path for proper cross-platform file URL construction, or handle the error case instead of silently converting to None with .ok().

Copilot uses AI. Check for mistakes.
Comment on lines +259 to +263
\x20 <td>{name_html}</td>\n\
\x20 <td>{desc_html}</td>\n\
\x20 <td>{args_html}</td>\n\
\x20 <td><code>{example_html}</code></td>\n\
\x20 </tr>"
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The HTML generation uses raw string concatenation with \x20 escape sequences for spaces. Consider using a templating library like askama or extracting the HTML template to a separate file for better maintainability and readability.

Copilot uses AI. Check for mistakes.
- [TOML functions](reference/toml_functions.md)
- [YAML functions](reference/yaml_functions.md)
- [XML functions](reference/xml_functions.md)
- [Builtin selectors and functions](builtins.html)
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The link references builtins.html but there's no indication that this file will be generated or exists. Ensure this HTML file is created as part of the documentation build process or update the link to point to the correct location.

Suggested change
- [Builtin selectors and functions](builtins.html)
- [Builtin selectors and functions](reference/builtins.md)

Copilot uses AI. Check for mistakes.
@harehare harehare merged commit cea2163 into main Feb 11, 2026
8 checks passed
@harehare harehare deleted the feat/extract-check-and-docs-crates branch February 11, 2026 13:41
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