MAINTENANCE: Test code blocks#80
Conversation
✅ Deploy Preview for highlighter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the documentation experience by introducing interactive code tabs for displaying platform-specific examples, primarily for Bash and PowerShell. Concurrently, it bolsters documentation reliability by adding automated scripts to validate the syntax of code blocks and ensure the correctness of referenced CLI commands. These changes improve both the usability and accuracy of the project's technical documentation. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
514c26c to
2672d42
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a significant improvement to the documentation by adding PowerShell examples for CLI commands and implementing a tabbed interface to display code blocks for different shells. It also adds two new validation scripts to check the correctness of code blocks and hl commands in the documentation, which is a great step towards maintaining documentation quality. The implementation of the code tabs feature using a Zola shortcode, CSS, and JavaScript is well-executed. My review includes a couple of suggestions to improve the idiomatic usage of PowerShell in one of the examples and to enhance the safety of one of the new bash scripts.
I am having trouble creating individual review comments. Click here to see my feedback.
content/docs/reference/sdk/network-discovery.md (270-280)
For more robust and idiomatic PowerShell, consider using the ConvertFrom-Csv cmdlet to parse the CSV output. This avoids manually splitting strings, which can be fragile, and allows accessing columns by their header name, making the code more readable and maintainable.
hl datasource discover batch --file macs.txt --quiet | ConvertFrom-Csv | ForEach-Object {
if ($_.IP -ne "not_found") {
Write-Host "Camera $($_.MAC) is at $($_.IP) (hostname: $($_.Hostname))"
# Perform actions on each camera
if (Test-Connection -ComputerName $_.IP -Count 1 -Quiet) { Write-Host " - Online" }
} else {
Write-Host "Camera $($_.MAC) not found on network"
}
}
scripts/check-code-blocks.sh (29)
Using eval can be risky and make scripts harder to reason about. For this increment operation, you can achieve the same result more safely using printf -v with indirect parameter expansion ${!1}. This avoids the potential for arbitrary code execution if the input were ever uncontrolled.
inc() { printf -v "$1" '%d' "$(( ${!1} + 1 ))"; }
2672d42 to
c91a13c
Compare
|
This was me, not Josh (Josh's SSH key was on ares and got used by |
06c757c to
ae9b21f
Compare
- `hl new` was removed; replaced with `hl generate agent` - `hl agent run` renamed to `hl agent start` - Also fixed typo: YOU_AGENT_DEF → YOUR_AGENT_DEF Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the bash-based hl command checker with two Python scripts that do deeper validation: - check-python-blocks.py: extracts Python code blocks from markdown and runs pyright (basic type checking, import resolution, undefined vars) against the installed highlighter-sdk. Catches wrong import paths like the CocoWriter issue from PR #83. - check-hl-commands.py: uses Click's make_context() to validate every documented hl command against the actual CLI tree — checking subcommand names, flag names, required flags, and argument types without executing any command callbacks. Also: - Fix scaffolds snippet: add missing imports, correct DataFile→DataSample - Add silverpond-nix to flake.nix for local dev with SDK + pyright - Merge CI jobs into single sdk-validation job Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop cachix/install-nix-action and magic-nix-cache in favour of the self-hosted runner that already has nix, matching the highlighter repo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7622886 to
6df048c
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation by fixing typos, updating CLI commands, and transitioning API references from DataFile to DataSample. It also introduces three new validation scripts to check the syntax and correctness of Bash, JSON, and Python code blocks within the markdown files. The Nix environment has been updated to include these tools and relax specific Python dependency constraints. Feedback focuses on improving the shell script's robustness and security by avoiding eval and ensuring temporary files are cleaned up using traps.
Address Gemini review: use local -n (nameref) instead of eval in the inc() helper to avoid potential code injection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Switch trigger to workflow_dispatch only. Scripts can be run locally via nix develop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI fixes: - datasource import: --file → -i, remove --create-missing/--update-existing (import always upserts), --output → -o - datasource export: replace with `hl datasource list --format json > file` (export downloads data files, not definitions) - training-run read: --id is not an option, use positional arg - agent start: -f doesn't exist, file path is positional Python fixes: - data-source-cli.md: HLClient() → HLClient.from_env() - Tune pyright config to suppress SDK type-stub false positives (reportAttributeAccessIssue, reportCallIssue, reportArgumentType) All three scripts now pass cleanly: - 95/95 hl commands, 4/4 Python blocks, 0 bash/JSON errors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

No description provided.