Skip to content

Commit 724b3e3

Browse files
author
Luca Bianconi
committed
chore: added json schema for configuration file
1 parent 6bf2c23 commit 724b3e3

File tree

4 files changed

+152
-1
lines changed

4 files changed

+152
-1
lines changed

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ See [how to contribute](https://arduino.github.io/arduino-cli/latest/CONTRIBUTIN
99
- [ ] Tests for the changes have been added (for bug fixes / features)
1010
- [ ] Docs have been added / updated (for bug fixes / features)
1111
- [ ] `UPGRADING.md` has been updated with a migration guide (for breaking changes)
12+
- [ ] `configuration.schema.json` updated if new parameters are added.
1213

1314
## What kind of change does this PR introduce?
1415

Diff for: .github/workflows/publish-go-tester-task.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ jobs:
111111
- task: protoc:collect
112112
path: "*_proto.zip"
113113
name: rpc-protocol-files
114+
- task: dist:jsonschema
115+
path: "*configuration.schema.json"
116+
name: configuration-schema
114117

115118
steps:
116119
- name: Checkout repository
@@ -146,7 +149,6 @@ jobs:
146149
steps:
147150
- name: Download build artifacts
148151
uses: actions/download-artifact@v3
149-
150152
- name: Output checksum
151153
run: |
152154
TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"

Diff for: Taskfile.yml

+5
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ tasks:
329329
desc: Returns the version used in the project
330330
cmds:
331331
- echo {{.VERSION}}
332+
dist:jsonschema:
333+
desc: Copy the jsonschema to dist folder
334+
cmds:
335+
- mkdir --parents {{.DIST_DIR}}
336+
- cp ./configuration/configuration.schema.json {{.DIST_DIR}}/{{.PROJECT_NAME}}_{{.VERSION}}_configuration.schema.json
332337

333338
vars:
334339
PROJECT_NAME: "arduino-cli"

Diff for: configuration/configuration.schema.json

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"title": "Arduino CLI configuration schema",
3+
"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",
4+
"properties": {
5+
"board_manager": {
6+
"description": "",
7+
"properties": {
8+
"additional_urls": {
9+
"description": "the URLs to any additional Boards Manager package index files needed for your boards platforms.",
10+
"type": "string"
11+
}
12+
},
13+
"type": "object"
14+
},
15+
"build_cache": {
16+
"description": "configuration options related to the compilation cache",
17+
"properties": {
18+
"compilations_before_purge": {
19+
"description": "interval, in number of compilations, at which the cache is purged, defaults to `10`. When `0` the cache is never purged.",
20+
"type": "number",
21+
"format": "integer",
22+
"minimum": 0
23+
},
24+
"ttl": {
25+
"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)",
26+
"type": "number",
27+
"format": "integer",
28+
"minimum": 0
29+
}
30+
},
31+
"type": "object"
32+
},
33+
"daemon": {
34+
"description": "options related to running Arduino CLI as a [gRPC] server.",
35+
"properties": {
36+
"port": {
37+
"description": "TCP port used for gRPC client connections.",
38+
"type": "number",
39+
"format": "integer",
40+
"minimum": 0
41+
}
42+
},
43+
"type": "object"
44+
},
45+
"directories": {
46+
"description": "directories used by Arduino CLI.",
47+
"properties": {
48+
"builtin.libraries": {
49+
"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.",
50+
"type": "string"
51+
},
52+
"builtin.tools": {
53+
"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.",
54+
"type": "string"
55+
},
56+
"data": {
57+
"description": "directory used to store Boards/Library Manager index files and Boards Manager platform installations.",
58+
"type": "string"
59+
},
60+
"downloads": {
61+
"description": "directory used to stage downloaded archives during Boards/Library Manager installations.",
62+
"type": "string"
63+
},
64+
"user": {
65+
"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.",
66+
"type": "string"
67+
}
68+
},
69+
"type": "object"
70+
},
71+
"library": {
72+
"description": "configuration options relating to Arduino libraries.",
73+
"properties": {
74+
"enable_unsafe_install": {
75+
"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.",
76+
"type": "boolean"
77+
}
78+
},
79+
"type": "object"
80+
},
81+
"locale": {
82+
"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`).",
83+
"type": "string"
84+
},
85+
"logging": {
86+
"description": "configuration options for Arduino CLI's logs.",
87+
"properties": {
88+
"file": {
89+
"description": "path to the file where logs will be written.",
90+
"type": "string"
91+
},
92+
"format": {
93+
"description": "output format for the logs. Allowed values are `text` or `json`.",
94+
"type": "string",
95+
"enum": ["text", "json"]
96+
},
97+
"level": {
98+
"description": "messages with this level and above will be logged. Valid levels are: `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`.",
99+
"type": "string",
100+
"enum": ["trace", "debug", "info", "warn", "error", "fatal"]
101+
}
102+
},
103+
"type": "object"
104+
},
105+
"metrics": {
106+
"description": "settings related to the collection of data used for continued improvement of Arduino CLI.",
107+
"properties": {
108+
"addr": {
109+
"description": "TCP port used for metrics communication.",
110+
"type": "number",
111+
"format": "integer",
112+
"minimum": 0
113+
},
114+
"enabled": {
115+
"description": "controls the use of metrics.",
116+
"type": "boolean"
117+
}
118+
},
119+
"type": "object"
120+
},
121+
"sketch": {
122+
"description": "configuration options relating to [Arduino sketches][sketch specification].",
123+
"properties": {
124+
"always_export_binaries": {
125+
"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.",
126+
"type": "boolean"
127+
}
128+
},
129+
"type": "object"
130+
},
131+
"updater": {
132+
"description": "configuration options related to Arduino CLI updates",
133+
"properties": {
134+
"enable_notification": {
135+
"description": "set to `false` to disable notifications of new Arduino CLI releases, defaults to `true`",
136+
"type": "boolean"
137+
}
138+
},
139+
"type": "object"
140+
}
141+
},
142+
"type": "object"
143+
}

0 commit comments

Comments
 (0)