All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] bitbake-setup JSON Schema: Fix linting errors
@ 2026-04-07 15:02 Rob Woolley
  2026-04-07 15:02 ` [PATCH v2 1/9] bitbake-setup.schema.json: Add title for schema Rob Woolley
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Rob Woolley @ 2026-04-07 15:02 UTC (permalink / raw)
  To: bitbake-devel

UPDATES v2:
  The following updates were made to v2 of this series:
   * Include an additional patch fixing an existing typo
   * Update the examples property to wrap it in an array and
     add a required configuration element

This series fixes some linting errors in the JSON Schema.  Problems
were found using the https://github.com/sourcemeta/jsonschema tool.

Here are the steps used to install and use the tool to lint the schemas:

# Setup the jsonschema CLI tool
```
  python3 -m venv venv
  source venv/bin/activate
  pip install sourcemeta-jsonschema
```

# Validate the schemas

```
jsonschema lint setup-schema/bitbake-setup.schema.json
jsonschema lint setup-schema/layers.schema.json
```

# Check the examples

NOTE: The examples are annotations and are meant for humans reading the schema.
They do not typically get checked automatically by the JSON Schema validation
tools.  Use jq to extract the JSON object into its own file to check it
separately.

```
cd setup-schema

jq .examples[] bitbake-setup.schema.json  > bitbake-setup.schema-examples.json
jsonschema validate bitbake-setup.schema.json bitbake-setup.schema-examples.json


jq .examples[] layers.schema.json  > layers.schema-examples.json
jsonschema validate layers.schema.json layers.schema-examples.json
cd ..
```

# Check the default-registry/configurations
```
jsonschema validate setup-schema/bitbake-setup.schema.json default-registry/configurations/oe-nodistro-master.conf.json
jsonschema validate setup-schema/bitbake-setup.schema.json default-registry/configurations/oe-nodistro-whinlatter.conf.json
jsonschema validate setup-schema/bitbake-setup.schema.json default-registry/configurations/poky-master.conf.json
jsonschema validate setup-schema/bitbake-setup.schema.json default-registry/configurations/poky-whinlatter.conf.json
```


There are 2 outstanding types of linting errors related to the use of hyphen
in the property names and the enum currently having only one value:

  Set `properties` to identifier names that can be easily mapped to programming
  languages (matching [A-Za-z_][A-Za-z0-9_]*) (simple_properties_identifiers).

  An `enum` of a single value can be expressed as `const` (enum_to_const)

The former would require a larger discussion and potentially increasing the
version number. Updating the enum to include a new version would also resolve
the latter error.

I do not believe that the changes in this series merit increasing the version
of the schema.

Resolving these outstanding errors is not necessary for validating the
Bitbake Configuration files.

UPDATE v2: Additional testing was performed with oe-selftest.  This uses
    python3-jsonschema which is a different implementation and caught
    additional linting errors.


```
    git clone https://git.openembedded.org/bitbake
    
    ./bitbake/bin/bitbake-setup init --non-interactive poky-master poky machine/qemux86-64 distro/poky
    
    . /ala-lpggp31/rwoolley/oe-selftest-testing/bitbake-builds/poky-master/build/init-build-env
    
    echo 'SANITY_TESTED_DISTROS = ""' >> conf/local.conf
    
    oe-selftest -r bblayers.BitbakeLayers.test_bitbakelayers_setup \
                   bblayers.BitbakeLayers.test_bitbakelayers_updatelayer \
                   bblayers.BitbakeLayers.test_validate_examplelayersjson \
                   bblayers.BitbakeLayers.test_validate_bitbake_setup_default_registry
```


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-05-28 11:06 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 15:02 [PATCH v2 0/9] bitbake-setup JSON Schema: Fix linting errors Rob Woolley
2026-04-07 15:02 ` [PATCH v2 1/9] bitbake-setup.schema.json: Add title for schema Rob Woolley
2026-05-28 10:41   ` [bitbake-devel] " Yoann Congal
2026-04-07 15:02 ` [PATCH v2 2/9] bitbake-setup.schema.json: Add examples property Rob Woolley
2026-05-28 10:48   ` [bitbake-devel] " Yoann Congal
2026-04-07 15:02 ` [PATCH v2 3/9] bitbake-setup.schema.json: Use anyOf for non-disjoint subschemas Rob Woolley
2026-05-28 10:48   ` [bitbake-devel] " Yoann Congal
2026-04-07 15:02 ` [PATCH v2 4/9] bitbake-setup.schema.json: Remove trailing period Rob Woolley
2026-05-28 10:48   ` [bitbake-devel] " Yoann Congal
2026-04-07 15:02 ` [PATCH v2 5/9] layers.schema.json: Add missing schema Rob Woolley
2026-05-28 10:49   ` [bitbake-devel] " Yoann Congal
2026-04-07 15:02 ` [PATCH v2 6/9] layers.schema.json: Add title for subschema Rob Woolley
2026-05-28 10:58   ` [bitbake-devel] " Yoann Congal
2026-04-07 15:02 ` [PATCH v2 7/9] layers.schema.json: Add examples property Rob Woolley
2026-05-28 11:04   ` [bitbake-devel] " Yoann Congal
2026-04-07 15:02 ` [PATCH v2 8/9] layers.schema.json: Remove trailing period Rob Woolley
2026-05-28 11:05   ` [bitbake-devel] " Yoann Congal
2026-04-07 15:02 ` [PATCH v2 9/9] layers.schema.json: Fix typo in property name Rob Woolley
2026-05-28 11:06   ` [bitbake-devel] " Yoann Congal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.