-
-
Notifications
You must be signed in to change notification settings - Fork 405
chore: added json schema for configuration file #2068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
ed29087
chore: added json schema for configuration file
fb6e552
fix: additional_urls type
8aa6453
fix(ci): tasks conditions
b967fe4
Merge branch 'master' into chore/json-schema
Bikappa 3d24c9b
Update .github/workflows/release-go-task.yml
Bikappa 6f7a4c7
Update configuration/configuration.schema.json
Bikappa 19b12de
Update configuration/configuration.schema.json
Bikappa d096c6d
Update DistTasks.yml
Bikappa f7e5f86
chore: refine schema
ca67a90
Merge branch 'chore/json-schema' of github.com:arduino/arduino-cli in…
99eb639
test: validate json schema
f12b648
Update configuration/configuration.schema.json
Bikappa 1e68bcb
Merge branch 'master' into chore/json-schema
Bikappa f89612d
chore: schema updates
15a26dd
chore: update schema
9e4d7d7
Update configuration/configuration.schema.json
Bikappa 8ad388e
chore: refined workflows
fd94ccd
Merge branch 'chore/json-schema' of github.com:arduino/arduino-cli in…
34d95f8
Update configuration/configuration.schema.json
Bikappa 1d51c36
Update configuration/configuration.schema.json
Bikappa 87ce9b7
Merge branch 'master' into chore/json-schema
Bikappa 20a990e
fix: json
a46c294
Update docs/configuration.md
Bikappa 23aeee2
chore: reorder paragraph
7b64b03
Merge branch 'master' into chore/json-schema
Bikappa 3215547
Merge branch 'chore/json-schema' of github.com:arduino/arduino-cli in…
46cf49b
Update configuration/configuration.schema.json
Bikappa 46fadf1
Merge branch 'master' into chore/json-schema
Bikappa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ jobs: | |
- Linux_ARM64 | ||
- macOS_64bit | ||
- macOS_ARM64 | ||
- jsonschema | ||
|
||
steps: | ||
- name: Checkout repository | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
{ | ||
"title": "Arduino CLI configuration schema", | ||
"description": "Describe the parameters available for the Arduino CLI configuration file. This schema should be considered unstable at this moment, it is not used by the CLI to validate input configuration", | ||
"$schema": "http://json-schema.org/draft-06/schema#", | ||
"properties": { | ||
Bikappa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"board_manager": { | ||
"description": "", | ||
"properties": { | ||
"additional_urls": { | ||
"description": "the URLs to any additional Boards Manager package index files needed for your boards platforms.", | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"build_cache": { | ||
"description": "configuration options related to the compilation cache", | ||
"properties": { | ||
"compilations_before_purge": { | ||
"description": "interval, in number of compilations, at which the cache is purged, defaults to `10`. When `0` the cache is never purged.", | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"ttl": { | ||
"description": "cache expiration time of build folders. If the cache is hit by a compilation the corresponding build files lifetime is renewed. The value format must be a valid input for time.ParseDuration(), defaults to `720h` (30 days)", | ||
"oneOf": [ | ||
{ | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
{ | ||
"type": "string", | ||
"pattern": "^[-+]?([0-9]*(\\.[0-9]*)?[a-z]+)+$" | ||
per1234 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
] | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"daemon": { | ||
"description": "options related to running Arduino CLI as a [gRPC] server.", | ||
"properties": { | ||
"port": { | ||
"description": "TCP port used for gRPC client connections.", | ||
"type": "string", | ||
"pattern": "^[0-9]+$" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"directories": { | ||
"description": "directories used by Arduino CLI.", | ||
"properties": { | ||
"builtin": { | ||
"description": "", | ||
"properties": { | ||
"libraries": { | ||
"description": "the libraries in this directory will be available to all platforms without the need for the user to install them, but with the lowest priority over other installed libraries with the same name, it's the equivalent of the Arduino IDE's bundled libraries directory.", | ||
"type": "string" | ||
}, | ||
"tools": { | ||
"description": "it's a list of directories of tools that will be available to all platforms without the need for the user to install them, it's the equivalent of the Arduino IDE 1.x bundled tools directory.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"data": { | ||
"description": "directory used to store Boards/Library Manager index files and Boards Manager platform installations.", | ||
"type": "string" | ||
}, | ||
"downloads": { | ||
"description": "directory used to stage downloaded archives during Boards/Library Manager installations.", | ||
"type": "string" | ||
}, | ||
"user": { | ||
"description": "the equivalent of the Arduino IDE's [\"sketchbook\" directory][sketchbook directory]. Library Manager installations are made to the `libraries` subdirectory of the user directory.", | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"library": { | ||
"description": "configuration options relating to Arduino libraries.", | ||
"properties": { | ||
"enable_unsafe_install": { | ||
"description": "set to `true` to enable the use of the `--git-url` and `--zip-file` flags with [`arduino-cli lib install`][arduino cli lib install]. These are considered \"unsafe\" installation methods because they allow installing files that have not passed through the Library Manager submission process.", | ||
"type": "boolean" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"locale": { | ||
"description": "the language used by Arduino CLI to communicate to the user, the parameter is the language identifier in the standard POSIX format `<language>[_<TERRITORY>[.<encoding>]]` (for example `it` or `it_IT`, or `it_IT.UTF-8`).", | ||
"type": "string" | ||
}, | ||
"logging": { | ||
"description": "configuration options for Arduino CLI's logs.", | ||
"properties": { | ||
"file": { | ||
"description": "path to the file where logs will be written.", | ||
"type": "string" | ||
}, | ||
"format": { | ||
"description": "output format for the logs. Allowed values are `text` or `json`.", | ||
"type": "string", | ||
"enum": ["text", "json"] | ||
}, | ||
"level": { | ||
"description": "messages with this level and above will be logged. Valid levels are: `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`.", | ||
"type": "string", | ||
"enum": ["trace", "debug", "info", "warn", "error", "fatal", "panic"] | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"metrics": { | ||
"description": "settings related to the collection of data used for continued improvement of Arduino CLI.", | ||
"properties": { | ||
"addr": { | ||
"description": "TCP port used for metrics communication.", | ||
"type": "string" | ||
}, | ||
"enabled": { | ||
"description": "controls the use of metrics.", | ||
"type": "boolean" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"sketch": { | ||
"description": "configuration options relating to [Arduino sketches][sketch specification].", | ||
"properties": { | ||
"always_export_binaries": { | ||
"description": "set to `true` to make [`arduino-cli compile`][arduino-cli compile] always save binaries to the sketch folder. This is the equivalent of using the [`--export-binaries`][arduino-cli compile options] flag.", | ||
"type": "boolean" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"updater": { | ||
"description": "configuration options related to Arduino CLI updates", | ||
"properties": { | ||
"enable_notification": { | ||
"description": "set to `false` to disable notifications of new Arduino CLI releases, defaults to `true`", | ||
"type": "boolean", | ||
"default": true | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
}, | ||
"type": "object" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package configuration | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"github.com/xeipuuv/gojsonschema" | ||
) | ||
|
||
func TestConfigurationSchemaValidity(t *testing.T) { | ||
schemaBytes, err := ioutil.ReadFile("configuration.schema.json") | ||
require.NoError(t, err) | ||
|
||
jl := gojsonschema.NewBytesLoader(schemaBytes) | ||
sl := gojsonschema.NewSchemaLoader() | ||
_, err = sl.Compile(jl) | ||
require.NoError(t, err) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.