Skip to content

Commit 90528fb

Browse files
committed
feat: add a clang-format playground
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.
1 parent 78e0c77 commit 90528fb

8 files changed

Lines changed: 880 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# cpp-linter.github.io
22

3-
The source of <https://cpp-linter.github.io/>: the home page, Get started, Why cpp-linter, the
4-
showcase, the blog and the community and sponsor pages.
3+
The source of <https://cpp-linter.github.io/>: the home page, Get started, the clang-format
4+
playground, Why cpp-linter, the showcase, the blog and the community and sponsor pages.
55

66
[Website](https://cpp-linter.github.io/) ·
77
[Get started](https://cpp-linter.github.io/getting-started/) ·

0 commit comments

Comments
 (0)