Skip to content

feat(yaml): relaxing the requirement for the CAPI=2: directive that must be in the first line - #800

Open
tymonx wants to merge 1 commit into
olofk:mainfrom
tymonx:feature/yaml-core-relaxed
Open

feat(yaml): relaxing the requirement for the CAPI=2: directive that must be in the first line#800
tymonx wants to merge 1 commit into
olofk:mainfrom
tymonx:feature/yaml-core-relaxed

Conversation

@tymonx

@tymonx tymonx commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closes #792

This will allow to follow the YAML specification as-is in FuseSoC core files. Originally, FuseSoC requires to have the CAPI=2: directive in the first line. This had many implications:

  • Couldn't use YAML formatter tools on FuseSoC core files out-of-box. It requires non-default configuration settings
  • Couldn't use YAML linter tools on FuseSoC core files out-of-box. It requires non-default configuration settings
  • Couldn't use the YAML start document indicator --- making some tools unhappy about that
  • Couldn't use comments before the CAPI=2: directive like SPDX headers required by some licenses validation tools
  • Couldn't use YAML directives like %YAML 1.2 or %TAG
  • Couldn't have empty lines
  • The CAPI=2 property was not part of the JSON schema validation

Now something like this is possible:

%YAML 1.2
---
# SPDX-FileCopyrightText: © 2026 John Doe <john.doe@fusesoc.com>
# SPDX-License-Identifier: Apache-2.0

CAPI=2:

Still FuseSoC will require the CAPI=2: directive at the beginning of core files but at least users can use YAML directives %, YAML start document indicator ---, comments, empty lines, YAML formatter/linter tools or licenses validation tools.

This PR is also including some unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: relax the rule for the CAPI=2: in core files that it must be in the first line

1 participant