diff options
| author | Sam Estep <sam@samestep.com> | 2025-08-18 11:10:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-18 15:10:27 +0000 |
| commit | 09054bff3d0874a92958b514ae2a9ff2b32483e5 (patch) | |
| tree | 0a7f8684da2a749139e58d4af4dfef9c2c56d0e7 /source | |
| parent | 2f68f98a3d7d41c1daac07afab622c34f5c1b8d4 (diff) | |
Don't let clang-format reorder Fiddle `#include`s (#7887)
The documentation added by #6844 included instructions to make sure that
the Fiddle `#include` in a file comes after all the other `#include`s,
but it's easy to accidentally violate this via `clang-format`, as
happened for `source/slang/slang-ast-modifier.h` in #7559. This PR
guards against this sort of violation by separating all Fiddle
`#include`s from other `#include`s via a blank line followed by a `//`
line (as we already do in most cases), and also adds a sentence about
this in `tools/slang-fiddle/README.md`.
As a bonus, I also enabled Markdown syntax highlighting for all the code
blocks in that doc file.
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ast-expr.h | 2 | ||||
| -rw-r--r-- | source/slang/slang-ast-modifier.h | 4 | ||||
| -rw-r--r-- | source/slang/slang-ast-stmt.h | 2 | ||||
| -rw-r--r-- | source/slang/slang-ast-val.h | 2 |
4 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/slang-ast-expr.h b/source/slang/slang-ast-expr.h index 32c724e10..adbc7a2ba 100644 --- a/source/slang/slang-ast-expr.h +++ b/source/slang/slang-ast-expr.h @@ -2,6 +2,8 @@ #pragma once #include "slang-ast-base.h" + +// #include "slang-ast-expr.h.fiddle" FIDDLE() diff --git a/source/slang/slang-ast-modifier.h b/source/slang/slang-ast-modifier.h index b5fa25418..2f9c29d6c 100644 --- a/source/slang/slang-ast-modifier.h +++ b/source/slang/slang-ast-modifier.h @@ -2,9 +2,11 @@ #pragma once #include "slang-ast-base.h" -#include "slang-ast-modifier.h.fiddle" #include "slang-ir-insts-enum.h" +// +#include "slang-ast-modifier.h.fiddle" + FIDDLE() namespace Slang { diff --git a/source/slang/slang-ast-stmt.h b/source/slang/slang-ast-stmt.h index f5436a70e..485ddd439 100644 --- a/source/slang/slang-ast-stmt.h +++ b/source/slang/slang-ast-stmt.h @@ -2,6 +2,8 @@ #pragma once #include "slang-ast-base.h" + +// #include "slang-ast-stmt.h.fiddle" FIDDLE() diff --git a/source/slang/slang-ast-val.h b/source/slang/slang-ast-val.h index f371d76fe..a381410b6 100644 --- a/source/slang/slang-ast-val.h +++ b/source/slang/slang-ast-val.h @@ -3,6 +3,8 @@ #include "slang-ast-base.h" #include "slang-ast-decl.h" + +// #include "slang-ast-val.h.fiddle" FIDDLE() |
