Skip to content

Skip Directives

Place these before the code block or inside it:

Directive Format
<!-- skip-validate --> HTML comment
<!-- skip-md-validate --> HTML comment
<!-- md-skip --> HTML comment
<!-- no-validate --> HTML comment
// skip-validate Go comment
<!-- skip-validate -->
```go
type MyStruct struct {
Name string
}
```
```go
<!-- skip-validate -->
type MyStruct struct {
Name string
}
```
```go
// skip-validate
type MyStruct struct {
Name string
}
```

A directive before a block must be a standalone line — prose that merely mentions a directive (e.g. a changelog bullet about a removed //nolint) does not skip the next block. Inside a block, a directive anywhere in the content skips it.

Define your own skip directives in the config file or via CLI:

Terminal window
md-go-validator --skip-directive "<!-- sketch -->" .

Or in .md-go-validator.yaml:

skipDirectives:
- "<!-- sketch -->"
- "<!-- wip -->"

By default, skipped blocks do not cause validation failures. Use --fail-on-skipped to exit 1 if any blocks are skipped:

Terminal window
md-go-validator --fail-on-skipped .

This is useful in strict CI pipelines where all incomplete snippets should be explicitly marked with a meaningful directive.