Skip to content

Commit

Permalink
Adjust schema to match Supervisor 2021.2 new features (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Feb 8, 2021
1 parent 4fa937d commit 5fde090
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devices": {
"items": {
"pattern": "^(.*):(.*):([rwm]{1,3})$"
"type": "string"
},
"type": "array"
},
Expand Down Expand Up @@ -232,7 +232,12 @@
"type": "integer"
},
"tmpfs": {
"type": "string"
"default": false,
"type": ["string", "boolean"]
},
"uart": {
"default": false,
"type": "boolean"
},
"udev": {
"default": false,
Expand Down
16 changes: 16 additions & 0 deletions src/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ def is_default(validator, properties, instance, schema):
print(f"::error file={config}::'ports' and 'ports_description' do not match.")
exit_code = 1

if "auto_uart" in configuration:
print(f"::error file={config}::'auto_uart' is deprecated, use 'uart' instead.")
exit_code = 1

if any(":" in line for line in configuration.get("devices", [])):
print(
f"::error file={config}::'devices' uses a deprecated format, the new format uses a list of paths only."
)
exit_code = 1

if not isinstance(configuration.get("tmpfs", False), bool):
print(
f"::error file={config}::'tmpfs' use a deprecated format, it is a boolean now."
)
exit_code = 1

# Checks regarding build.json (if found)
build = path / "build.json"
if build.exists():
Expand Down

0 comments on commit 5fde090

Please sign in to comment.