Repository navigation
feat: add a clang-format playground - #104
Open
shenxianpeng wants to merge 2 commits into
Open
shenxianpeng wants to merge 2 commits into
shenxianpeng wants to merge 2 commits into
Conversation
✅ Deploy Preview for cpp-linter-github-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
A page at /playground/ where you paste C or C++ code, pick an LLVM version from 16 to 23 and a style (a preset or your own .clang-format), and see what clang-format changes as a diff or as the formatted file. clang-format runs in the browser: the WebAssembly builds of the @wasm-fmt/clang-format npm package are imported from jsDelivr, one per version picked, so the code never leaves the page. Below the result, the page shows the same check for the version and style picked: the clang-tools commands, the cpp-linter-hooks entry and the cpp-linter-action step. The URL hash keeps the code and settings, so "Copy link" shares what is on screen. The page is in the top navigation, the home page header and its footer. scripts/update-versions.py now also updates the cpp-linter-hooks rev in the playground's script.
Opening /playground/ no longer writes the sample code into the URL hash. The hash is written after the first change, and Copy link writes it as before.
shenxianpeng
force-pushed
the
claude/project-thread-1t3184
branch
from
November 20, 2026 23:38
223c49c to
f7ef69e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new page at
/playground/: paste C or C++ code, pick an LLVM version and a style, and see what clang-format changes.Preview: https://deploy-preview-104--cpp-linter-github-io.netlify.app/playground/
What it does
.clang-formattext. A bad config shows clang-format's own reason, for exampleUnknown value for BasedOnStyle: Nope.Where it is linked
mkdocs.yml).docs/overrides/home.html).scripts/update-versions.pynow also updates the cpp-linter-hooksrev:in the playground's script, so that example stays current like the others.Notes
playground.cssandplayground.jsload only on this page, throughdocs/overrides/playground.html.Checked
mkdocs build --strictand the repository's pre-commit hooks pass..clang-format, a broken config, already-formatted input, a shared link reopened in a new tab, and light, dark and 390 px wide layouts (no sideways scroll). The same run passes on the deploy preview.