Make hiredis jupyter example interactive#3306
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
|
@andy-stark-redis Are you ok with having |
Can you place that line before the |
andy-stark-redis
left a comment
There was a problem hiding this comment.
Most impressive one so far! Definitely approved :-)
|
@andy-stark-redis It has to be after Yeah, it might be helpful to add it just to avoid the reader thinking it's required for hiredis generally. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fc03082. Configure here.
| {{ if or (eq $trimmed "") (not (hasPrefix $trimmed $commentPrefix)) }} | ||
| {{ $currentSection = $currentSection | append . }} | ||
| {{ if $inCurrentStep }} | ||
| {{ $currentStepLines = $currentStepLines | append . }} |
There was a problem hiding this comment.
Comment filter removal unintentionally changes all existing examples
Medium Severity
Removing the comment-only line filter here is a global change that affects all languages using this shortcode, not just C. For instance, the Python landing.py steps set_get_string and hash_operations contain comment-only lines like # True, # bar, and # {'surname': 'Smith', ...} that were intentionally stripped before rendering. These will now appear in the displayed step code on the live redis-py landing page. The fix could be scoped more narrowly (e.g., only preserving lines matching the //% directive pattern) rather than removing all comment filtering.
Reviewed by Cursor Bugbot for commit fc03082. Configure here.


Note
Medium Risk
Moderate risk because it changes the shared Thebe/CodeMirror initialization in
baseof.html, including new dynamic loading of external CodeMirror mode code that could affect interactive code blocks site-wide.Overview
Enables the hiredis (C) landing example to run as an interactive
jupyter-exampleby adding the requiredKERNEL_NAMEand%cflagsdirectives in the C source and updating the guide to render it as a Thebe-backed snippet.Updates the
jupyter-exampleshortcode to preserve comment lines inside steps (so C magic comments aren’t dropped) and to emit the correct CodeMirror mode for C (text/x-csrc). Adds a matching Thebe workaround inbaseof.htmlto lazily load CodeMirror’s C/clikemode and re-apply it to activated C cells so syntax highlighting remains intact.Reviewed by Cursor Bugbot for commit 2b80a7d. Bugbot is set up for automated code reviews on this repo. Configure here.