Unverified Commit 02416e75 authored by Silvano Cerza's avatar Silvano Cerza Committed by GitHub

[skip changelog] Introduce linting and formatting for docs and config files (#836)

* [skip changelog] Add linting/formatting tasks and CI checks for docs and config files

* [skip changelog] Format all docs and config files

* [skip changelog] Update contributing documentation with formatting instructions

* [skip changelog] Fix some Prettier configuration issues

* [skip changelog] Format all config files

* [skip changelog] Fix documentation indentation issue

* [skip changelog] Removed files from .prettierignore

* [skip changelog] Update docs/package_index_json-specification.md
Co-authored-by: default avatarper1234 <accounts@perglass.com>

* [skip changelog] Format PR and issues templates

* [skip changelog] Format files after rebase

* [skip changelog] Update .prettierrc and reformat everything
Co-authored-by: default avatarper1234 <accounts@perglass.com>
parent 8449ac10
......@@ -7,4 +7,4 @@ update_configs:
- match:
update_type: "security"
default_labels:
- "component/dependencies"
\ No newline at end of file
- "component/dependencies"
......@@ -15,7 +15,7 @@ indent_size = 4
indent_style = space
indent_size = 4
[*.yml,*.tmpl]
[*.yml,*.yaml,*.tmpl]
indent_style = space
indent_size = 2
......
---
name: 🐛 Bug Report
about: If something isn't working as expected 🤔.
---
## Bug Report
### Current behavior
<!-- Paste the full command you run -->
<!-- Paste the full command you run -->
<!-- Add a clear and concise description of the behavior. -->
### Expected behavior
<!-- Add a clear and concise description of what you expected to happen. -->
<!-- Add a clear and concise description of what you expected to happen. -->
### Environment
......@@ -23,4 +21,5 @@ about: If something isn't working as expected 🤔.
- OS and platform:
### Additional context
<!-- (Optional) Add any other context about the problem here. -->
**Please check if the PR fulfills these requirements**
- [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-cli/pulls) before creating one)
- [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-cli/pulls)
before creating one)
- [ ] The PR follows [our contributing guidelines](https://arduino.github.io/arduino-cli/CONTRIBUTING/#pull-requests)
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
* **What kind of change does this PR introduce?**
<!-- Bug fix, feature, docs update, ... -->
* **What is the current behavior?**
- **What is the current behavior?**
<!-- You can also link to an open issue here -->
* **What is the new behavior?**
<!-- if this is a feature change -->
* **Does this PR introduce a breaking change?**
- **Does this PR introduce a breaking change?**
<!-- What changes might users need to make in their workflow or application due to this PR? -->
* **Other information**:
<!-- Any additional information that could help the review process -->
---
See [how to contribute](https://arduino.github.io/arduino-cli/CONTRIBUTING/)
......@@ -3,7 +3,7 @@ name: arduino-stats
on:
schedule:
# run every day at 12:30:00
- cron: '30 12 * * *'
- cron: "30 12 * * *"
jobs:
push-stats:
......
......@@ -4,27 +4,27 @@ on:
pull_request:
paths:
# existing docs
- 'docs/**'
- "docs/**"
# changes to the cli reference generator
- 'docsgen/**'
- "docsgen/**"
# potential changes to commands documentation
- 'cli/**'
- "cli/**"
# potential changes to gRPC documentation
- 'rpc/**'
- "rpc/**"
# changes to the workflow itself
- '.github/workflows/docs.yaml'
- ".github/workflows/docs.yaml"
push:
branches:
- master
# release branches have names like 0.8.x, 0.9.x, ...
- '[0-9]+.[0-9]+.x'
- "[0-9]+.[0-9]+.x"
# At this day, GitHub doesn't support YAML anchors, d'oh!
paths:
- 'docs/**'
- 'docsgen/**'
- 'cli/**'
- 'rpc/**'
- '.github/workflows/docs.yaml'
- "docs/**"
- "docsgen/**"
- "cli/**"
- "rpc/**"
- ".github/workflows/docs.yaml"
jobs:
build:
......@@ -42,7 +42,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2-beta
with:
go-version: '1.14'
go-version: "1.14"
- name: Install Go dependencies
run: |
......@@ -57,8 +57,8 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.6'
architecture: 'x64'
python-version: "3.6"
architecture: "x64"
- name: Cache dependencies
uses: actions/cache@v1
......
......@@ -3,7 +3,7 @@ name: github-stats
on:
schedule:
# run every 30 minutes
- cron: '*/30 * * * *'
- cron: "*/30 * * * *"
jobs:
push-stats:
......
......@@ -3,7 +3,7 @@ name: i18n-nightly-push
on:
schedule:
# run every day at 1AM
- cron: '0 1 * * *'
- cron: "0 1 * * *"
jobs:
push-to-transifex:
......@@ -15,7 +15,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.14'
go-version: "1.14"
- name: Install Taskfile
uses: Arduino/actions/setup-taskfile@master
......@@ -27,4 +27,4 @@ jobs:
env:
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }}
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}
\ No newline at end of file
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}
......@@ -3,7 +3,7 @@ name: i18n-weekly-pull
on:
schedule:
# run every monday at 2AM
- cron: '0 2 * * 1'
- cron: "0 2 * * 1"
jobs:
pull-from-transifex:
......@@ -15,7 +15,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.14'
go-version: "1.14"
- name: Install Go deps
run: |
......@@ -38,4 +38,4 @@ jobs:
with:
commit-message: Updated translation files
title: Updated translation files
branch: i18n/translations-update
\ No newline at end of file
branch: i18n/translations-update
......@@ -3,10 +3,9 @@ name: nightly
on:
schedule:
# run every day at 1AM
- cron: '0 1 * * *'
- cron: "0 1 * * *"
jobs:
create-nightly-artifacts:
runs-on: ubuntu-latest
......@@ -94,9 +93,9 @@ jobs:
- name: upload
uses: docker://plugins/s3
env:
PLUGIN_SOURCE: 'dist/*'
PLUGIN_TARGET: '/arduino-cli/nightly'
PLUGIN_STRIP_PREFIX: 'dist/'
PLUGIN_SOURCE: "dist/*"
PLUGIN_TARGET: "/arduino-cli/nightly"
PLUGIN_STRIP_PREFIX: "dist/"
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
......
......@@ -3,10 +3,9 @@ name: release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
create-release-artifacts:
runs-on: ubuntu-latest
......@@ -134,9 +133,9 @@ jobs:
- name: Upload release files on Arduino downloads servers
uses: docker://plugins/s3
env:
PLUGIN_SOURCE: 'dist/*'
PLUGIN_TARGET: '/arduino-cli/'
PLUGIN_STRIP_PREFIX: 'dist/'
PLUGIN_SOURCE: "dist/*"
PLUGIN_TARGET: "/arduino-cli/"
PLUGIN_STRIP_PREFIX: "dist/"
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
......
......@@ -3,9 +3,9 @@ name: stale-bot
on:
schedule:
# run every day at midnight
- cron: '0 0 * * *'
- cron: "0 0 * * *"
issue_comment:
types: ['created']
types: ["created"]
jobs:
stale-bot:
......
......@@ -30,7 +30,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.14'
go-version: "1.14"
- name: Install Go deps
# Since 10/23/2019 pwsh is the default shell
......
name: "Verify files formatting"
on:
push:
paths:
- "**/*.md"
- "**/*.yml"
- "**/*.yaml"
- ".prettierrc"
- ".prettierignore"
pull_request:
paths:
- "**/*.md"
- "**/*.yml"
- "**/*.yaml"
- ".prettierrc"
- ".prettierignore"
jobs:
verify-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install Taskfile
uses: Arduino/actions/setup-taskfile@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify formatting of all files
run: task docs:check config:check
......@@ -19,8 +19,7 @@ changelog:
# We have multiple builds in order to fine tune
# cross compilations.
builds:
-
# OSX
- # OSX
id: arduino_cli_osx
binary: arduino-cli
env:
......@@ -33,8 +32,7 @@ builds:
- amd64
ldflags:
- -s -w -X github.com/arduino/arduino-cli/version.versionString={{.Tag}} -X github.com/arduino/arduino-cli/version.commit={{ .ShortCommit }}
-
# ARM
- # ARM
id: arduino_cli_arm
binary: arduino-cli
env:
......@@ -49,8 +47,7 @@ builds:
ldflags:
- -s -w -X github.com/arduino/arduino-cli/version.versionString={{.Tag}} -X github.com/arduino/arduino-cli/version.commit={{ .ShortCommit }}
- "-extldflags '-static'"
-
# ARMv7
- # ARMv7
id: arduino_cli_armv7
binary: arduino-cli
env:
......@@ -65,8 +62,7 @@ builds:
ldflags:
- -s -w -X github.com/arduino/arduino-cli/version.versionString={{.Tag}} -X github.com/arduino/arduino-cli/version.commit={{ .ShortCommit }}
- "-extldflags '-static'"
-
# ARM64
- # ARM64
id: arduino_cli_arm64
binary: arduino-cli
env:
......@@ -79,8 +75,7 @@ builds:
ldflags:
- -s -w -X github.com/arduino/arduino-cli/version.versionString={{.Tag}} -X github.com/arduino/arduino-cli/version.commit={{ .ShortCommit }}
- "-extldflags '-static'"
-
# All the other platforms
- # All the other platforms
id: arduino_cli
binary: arduino-cli
env:
......@@ -96,8 +91,7 @@ builds:
- "-extldflags '-static'"
archives:
-
id: "arduino_cli"
- id: "arduino_cli"
format: tar.gz
format_overrides:
- goos: windows
......
# IDE files
.idea/
.vscode/
.vs/
.ionide/
{
"semi": false,
"printWidth": 120,
"overrides": [
{
"files": "*.md",
"options": {
"proseWrap": "always"
}
}
]
}
......@@ -2,17 +2,16 @@
![cli-logo](./docs/img/CLI_Logo_small.png)
Arduino CLI is an all-in-one solution that provides builder, boards/library manager,
uploader, discovery and many other tools needed to use any Arduino compatible
board and platforms.
Arduino CLI is an all-in-one solution that provides builder, boards/library manager, uploader, discovery and many other
tools needed to use any Arduino compatible board and platforms.
[![tests-badge]](https://github.com/Arduino/arduino-cli/actions?workflow=test)
[![nightly-badge]](https://github.com/Arduino/arduino-cli/actions?workflow=nightly)
[![docs-badge]](https://github.com/Arduino/arduino-cli/actions?workflow=docs)
[![codecov-badge]](https://codecov.io/gh/arduino/arduino-cli)
> **Note:** this software is currently under active development: anything can change
at any time, API and UI must be considered unstable until we release version 1.0.0.
> **Note:** this software is currently under active development: anything can change at any time, API and UI must be
> considered unstable until we release version 1.0.0.
## Docs
......@@ -29,29 +28,27 @@ For guidance on installation and development, see the [User documentation].
Contributions are welcome!
Please read the document [How to contribute] which will show you how to build
the source code, run the tests, and contribute your changes to the project.
Please read the document [How to contribute] which will show you how to build the source code, run the tests, and
contribute your changes to the project.
:sparkles: Thanks to all our [contributors]! :sparkles:
## Security
If you think you found a vulnerability or other security-related bug in the
Arduino CLI, please read our [security policy] and report the bug to our
Security Team 🛡️ Thank you!
If you think you found a vulnerability or other security-related bug in the Arduino CLI, please read our [security
policy] and report the bug to our Security Team 🛡️ Thank you!
e-mail contact: security@arduino.cc
[tests-badge]: https://github.com/Arduino/arduino-cli/workflows/test/badge.svg
[nightly-badge]: https://github.com/Arduino/arduino-cli/workflows/nightly/badge.svg
[docs-badge]: https://github.com/Arduino/arduino-cli/workflows/docs/badge.svg
[codecov-badge]: https://codecov.io/gh/arduino/arduino-cli/branch/master/graph/badge.svg
[Install]: https://arduino.github.io/arduino-cli/installation
[User documentation]: https://arduino.github.io/arduino-cli/
[Getting Started]: https://arduino.github.io/arduino-cli/getting-started/
[Commands reference]: https://arduino.github.io/arduino-cli/commands/arduino-cli
[FAQ]: https://arduino.github.io/arduino-cli/FAQ/
[How to contribute]: https://arduino.github.io/arduino-cli/CONTRIBUTING/
[install]: https://arduino.github.io/arduino-cli/installation
[user documentation]: https://arduino.github.io/arduino-cli/
[getting started]: https://arduino.github.io/arduino-cli/getting-started/
[commands reference]: https://arduino.github.io/arduino-cli/commands/arduino-cli
[faq]: https://arduino.github.io/arduino-cli/FAQ/
[how to contribute]: https://arduino.github.io/arduino-cli/CONTRIBUTING/
[contributors]: https://github.com/arduino/arduino-cli/graphs/contributors
[security policy]: https://github.com/arduino/arduino-cli/security/policy
version: '2'
version: "2"
tasks:
docs:gen:commands:
......@@ -49,6 +49,16 @@ tasks:
cmds:
- mkdocs serve
docs:check:
desc: Run documentation linting
cmds:
- npx {{ .PRETTIER }} --check "**/*.md"
docs:format:
desc: Automatically formats documentation
cmds:
- npx {{ .PRETTIER }} --write "**/*.md"
protoc:
desc: Compile protobuf definitions
cmds:
......@@ -105,6 +115,18 @@ tasks:
- "'{{.GOLINTBIN}}' {{.GOLINTFLAGS}} {{ default .DEFAULT_TARGETS .TARGETS }}"
- task: i18n:check
- task: python:check
- task: docs:check
- task: config:check
config:check:
desc: Check linting of configuration and supporting files
cmds:
- npx {{ .PRETTIER }} --check "**/*.{yml,yaml}"
config:format:
desc: Automatically formats configuration and supporting files
cmds:
- npx {{ .PRETTIER }} --write "**/*.{yml,yaml}"
python:check:
desc: Linting for Python files
......@@ -183,3 +205,4 @@ vars:
DOCS_VERSION: dev
DOCS_ALIAS: ""
DOCS_REMOTE: "origin"
PRETTIER: prettier@2.0.5
This diff is collapsed.
......@@ -2,18 +2,16 @@
When you run `arduino-cli board list`, your board doesn't show up. Possible causes:
- Your board is a cheaper clone, or
- It mounts a USB2Serial converter like FT232 or CH340: these chips
always report the same USB VID/PID to the operating system, so the
only thing we know is that the board mounts that specific
USB2Serial chip, but we don’t know which board that chip is on.
- Your board is a cheaper clone, or
- It mounts a USB2Serial converter like FT232 or CH340: these chips always report the same USB VID/PID to the operating
system, so the only thing we know is that the board mounts that specific USB2Serial chip, but we don’t know which
board that chip is on.
## What's the FQBN string?
## What's the FQBN string?
For a deeper understanding of how FQBN works, you should understand
the [Arduino platform specification][0].
For a deeper understanding of how FQBN works, you should understand the [Arduino platform specification][0].
## How to set multiple board options?
## How to set multiple board options?
Additional board options have to be separated by commas (instead of colon):
......
`arduino-cli` supports command-line completion (also known as *tab completion*) for basic commands.
Currently only `bash`, `zsh`, `fish` shells are supported
`arduino-cli` supports command-line completion (also known as _tab completion_) for basic commands. Currently only
`bash`, `zsh`, `fish` shells are supported
### Before you start
In order to generate the file required to make the completion work you have to [install](installation.md) Arduino CLI first.
In order to generate the file required to make the completion work you have to [install](installation.md) Arduino CLI
first.
### Generate the completion file
To generate the completion file you can use `arduino-cli completion [bash|zsh|fish] [--no-descriptions]`.
By default this command will print on the standard output (the shell window) the content of the completion file. To save to an actual file use the `>` redirect symbol.
To generate the completion file you can use `arduino-cli completion [bash|zsh|fish] [--no-descriptions]`. By default
this command will print on the standard output (the shell window) the content of the completion file. To save to an
actual file use the `>` redirect symbol.
### Bash
Use `arduino-cli completion bash > arduino-cli.sh` to generate the completion file.
At this point you can move that file in `/etc/bash_completion.d/` (root access is required) with `sudo mv arduino-cli.sh /etc/bash_completion.d/`.
Use `arduino-cli completion bash > arduino-cli.sh` to generate the completion file. At this point you can move that file
in `/etc/bash_completion.d/` (root access is required) with `sudo mv arduino-cli.sh /etc/bash_completion.d/`.
A not recommended alternative is to source the completion file in `~/.bashrc`.
Remember to open a new shell to test the functionality.
### Zsh
Use `arduino-cli completion zsh > _arduino-cli` to generate the completion file.
At this point you can place the file in a directory listed in your `fpath` if you have already created a directory to store your completion.
Use `arduino-cli completion zsh > _arduino-cli` to generate the completion file. At this point you can place the file in
a directory listed in your `fpath` if you have already created a directory to store your completion.
Or if you want you can create a directory, add it to your `fpath` and copy the file in it:
......@@ -29,17 +35,24 @@ Or if you want you can create a directory, add it to your `fpath` and copy the f
Remember to open a new shell to test the functionality.
### Fish
Use `arduino-cli completion fish > arduino-cli.fish` to generate the completion file.
At this point you can place the file in `~/.config/fish/completions` as stated in the [official documentation](http://fishshell.com/docs/current/index.html#where-to-put-completions).
Remember to create the directory if it's not already there `mkdir -p ~/.config/fish/completions/` and then place the completion file in there with `mv arduino-cli.fish ~/.config/fish/completions/`
Use `arduino-cli completion fish > arduino-cli.fish` to generate the completion file. At this point you can place the
file in `~/.config/fish/completions` as stated in the
[official documentation](http://fishshell.com/docs/current/index.html#where-to-put-completions). Remember to create the
directory if it's not already there `mkdir -p ~/.config/fish/completions/` and then place the completion file in there
with `mv arduino-cli.fish ~/.config/fish/completions/`
Remember to open a new shell to test the functionality.
#### Disabling command and flag descriptions
By default fish completion has command and flag description enabled by default. If you want to disable this behaviour you can simply pass the `--no-descriptions` flag when calling `completion` command and the generated file will not have descriptions
*N.B.*
This flag is not compatible with bash or zsh
By default fish completion has command and flag description enabled by default. If you want to disable this behaviour
you can simply pass the `--no-descriptions` flag when calling `completion` command and the generated file will not have
descriptions
_N.B._ This flag is not compatible with bash or zsh
### Brew
If you install the `arduino-cli` using [homebrew](https://brew.sh/) package manager the completion should work out of the box if you have followed the [official documentation](https://docs.brew.sh/Shell-Completion).
If you install the `arduino-cli` using [homebrew](https://brew.sh/) package manager the completion should work out of
the box if you have followed the [official documentation](https://docs.brew.sh/Shell-Completion).
## Configuration keys
* `board_manager`
* `additional_urls` - the URLs to any additional Board Manager package index
files needed for your boards platforms.
* `daemon` - options related to running Arduino CLI as a [gRPC] server.
* `port` - TCP port used for gRPC client connections.
* `directories` - directories used by Arduino CLI.
* `data` - directory used to store Board/Library Manager index files and
Board Manager platform installations.
* `downloads` - directory used to stage downloaded archives during
Board/Library Manager installations.
* `user` - the equivalent of the Arduino IDE's
["sketchbook" directory][sketchbook directory]. Library Manager
installations are made to the `libraries` subdirectory of the user
directory.
* `logging` - configuration options for Arduino CLI's logs.
* `file` - path to the file where logs will be written.
* `format` - output format for the logs. Allowed values are `text` or
`json`.
* `level` - messages with this level and above will be logged. Valid levels
are: `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`.
* `telemetry` - settings related to the collection of data used for continued
improvement of Arduino CLI.
* `addr` - TCP port used for telemetry communication.
* `enabled` - controls the use of telemetry.
- `board_manager`
- `additional_urls` - the URLs to any additional Board Manager package index files needed for your boards platforms.
- `daemon` - options related to running Arduino CLI as a [gRPC] server.
- `port` - TCP port used for gRPC client connections.
- `directories` - directories used by Arduino CLI.
- `data` - directory used to store Board/Library Manager index files and Board Manager platform installations.
- `downloads` - directory used to stage downloaded archives during Board/Library Manager installations.
- `user` - the equivalent of the Arduino IDE's ["sketchbook" directory][sketchbook directory]. Library Manager
installations are made to the `libraries` subdirectory of the user directory.
- `logging` - configuration options for Arduino CLI's logs.
- `file` - path to the file where logs will be written.
- `format` - output format for the logs. Allowed values are `text` or `json`.
- `level` - messages with this level and above will be logged. Valid levels are: `trace`, `debug`, `info`, `warn`,
`error`, `fatal`, `panic`.
- `telemetry` - settings related to the collection of data used for continued improvement of Arduino CLI.
- `addr` - TCP port used for telemetry communication.
- `enabled` - controls the use of telemetry.
## Configuration methods
......@@ -33,23 +26,20 @@ Arduino CLI may be configured in three ways:
1. Environment variables
1. Configuration file
If a configuration option is configured by multiple methods, the value set by
the method highest on the above list overwrites the ones below it.
If a configuration option is configured by multiple methods, the value set by the method highest on the above list
overwrites the ones below it.
If a configuration option is not set, Arduino CLI uses a default value.
[`arduino-cli config dump`][arduino-cli config dump] displays the current
configuration values.
[`arduino-cli config dump`][arduino-cli config dump] displays the current configuration values.
### Command line flags
Arduino CLI's command line flags are documented in the command line help and the
[Arduino CLI command reference].
Arduino CLI's command line flags are documented in the command line help and the [Arduino CLI command reference].
#### Example
Setting an additional Board Manager URL using the
[`--additional-urls`][arduino-cli global flags] command line flag:
Setting an additional Board Manager URL using the [`--additional-urls`][arduino-cli global flags] command line flag:
```shell
$ arduino-cli core update-index --additional-urls https://downloads.arduino.cc/packages/package_staging_index.json
......@@ -57,19 +47,16 @@ $ arduino-cli core update-index --additional-urls https://downloads.arduino.cc/p
### Environment variables
All configuration options can be set via environment variables. The variable
names start with `ARDUINO`, followed by the configuration key names, with each
component separated by `_`. For example, the `ARDUINO_DIRECTORIES_USER`
environment variable sets the `directories.user` configuration option.
All configuration options can be set via environment variables. The variable names start with `ARDUINO`, followed by the
configuration key names, with each component separated by `_`. For example, the `ARDUINO_DIRECTORIES_USER` environment
variable sets the `directories.user` configuration option.
On Linux or macOS, you can use the [`export` command][export command] to set
environment variables. On Windows cmd, you can use the
[`set` command][set command].
On Linux or macOS, you can use the [`export` command][export command] to set environment variables. On Windows cmd, you
can use the [`set` command][set command].
#### Example
Setting an additional Board Manager URL using the
`ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS` environment variable:
Setting an additional Board Manager URL using the `ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS` environment variable:
```sh
$ export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=https://downloads.arduino.cc/packages/package_staging_index.json
......@@ -77,11 +64,10 @@ $ export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=https://downloads.arduino.cc/pack
### Configuration file
[`arduino-cli config init`][arduino-cli config init] creates or updates a
configuration file with the current configuration settings.
[`arduino-cli config init`][arduino-cli config init] creates or updates a configuration file with the current
configuration settings.
This allows saving the options set by command line flags or environment
variables. For example:
This allows saving the options set by command line flags or environment variables. For example:
```sh
arduino-cli config init --additional-urls https://downloads.arduino.cc/packages/package_staging_index.json
......@@ -89,38 +75,33 @@ arduino-cli config init --additional-urls https://downloads.arduino.cc/packages/
#### File name
The configuration file must be named `arduino-cli`, with the appropriate file
extension for the file's format.
The configuration file must be named `arduino-cli`, with the appropriate file extension for the file's format.
#### Supported formats
`arduino-cli config init` creates a YAML file, however a variety of common
formats are supported:
`arduino-cli config init` creates a YAML file, however a variety of common formats are supported:
* [JSON]
* [TOML]
* [YAML]
* [Java properties file]
* [HCL]
* envfile
* [INI]
- [JSON]
- [TOML]
- [YAML]
- [Java properties file]
- [HCL]
- envfile
- [INI]
#### Locations
Configuration files in the following locations are recognized by Arduino CLI:
1. Location specified by the [`--config-file`][Arduino CLI command reference]
command line flag
1. Location specified by the [`--config-file`][arduino cli command reference] command line flag
1. Current working directory
1. Any parent directory of the current working directory (more immediate parents
having higher precedence)
1. Any parent directory of the current working directory (more immediate parents having higher precedence)
1. Arduino CLI data directory (as configured by `directories.data`)
If multiple configuration files are present, the one highest on the above list
is used. Configuration files are not combined.
If multiple configuration files are present, the one highest on the above list is used. Configuration files are not
combined.
The location of the active configuration file can be determined by running the
command:
The location of the active configuration file can be determined by running the command:
```sh
arduino-cli config dump --verbose
......@@ -133,7 +114,7 @@ Setting an additional Board Manager URL using a YAML format configuration file:
```yaml
board_manager:
additional_urls:
- https://downloads.arduino.cc/packages/package_staging_index.json
- https://downloads.arduino.cc/packages/package_staging_index.json
```
Doing the same using a TOML format file:
......@@ -143,18 +124,17 @@ Doing the same using a TOML format file:
additional_urls = [ "https://downloads.arduino.cc/packages/package_staging_index.json" ]
```
[gRPC]: https://grpc.io
[grpc]: https://grpc.io
[sketchbook directory]: sketch-specification.md#sketchbook
[arduino-cli config dump]: ../commands/arduino-cli_config_dump
[Arduino CLI command reference]: ../commands/arduino-cli
[arduino cli command reference]: ../commands/arduino-cli
[arduino-cli global flags]: ../commands/arduino-cli_config/#options-inherited-from-parent-commands
[export command]: https://ss64.com/bash/export.html
[set command]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1
[arduino-cli config init]: ../commands/arduino-cli_config_init
[JSON]: https://www.json.org
[TOML]: https://github.com/toml-lang/toml
[YAML]: https://en.wikipedia.org/wiki/YAML
[Java properties file]: https://en.wikipedia.org/wiki/.properties
[HCL]: https://github.com/hashicorp/hcl
[INI]: https://en.wikipedia.org/wiki/INI_file
[json]: https://www.json.org
[toml]: https://github.com/toml-lang/toml
[yaml]: https://en.wikipedia.org/wiki/YAML
[java properties file]: https://en.wikipedia.org/wiki/.properties
[hcl]: https://github.com/hashicorp/hcl
[ini]: https://en.wikipedia.org/wiki/INI_file
This diff is collapsed.
Arduino CLI is an all-in-one solution that provides builder, boards/library manager,
uploader, discovery and many other tools needed to use any Arduino compatible board
and platforms.
Arduino CLI is an all-in-one solution that provides builder, boards/library manager, uploader, discovery and many other
tools needed to use any Arduino compatible board and platforms.
## Installation
You have several options to install the latest version of the Arduino
CLI on your system, see the [installation] page.
You have several options to install the latest version of the Arduino CLI on your system, see the [installation] page.
## Getting started
Follow the [Getting started guide] to see how to use the most
common CLI commands available.
Follow the [Getting started guide] to see how to use the most common CLI commands available.
## Using the gRPC interface
The [client_example] folder contains a sample program that shows how to use gRPC
interface of the CLI. Available services and messages are detailed in the
[gRPC reference] pages.
The [client_example] folder contains a sample program that shows how to use gRPC interface of the CLI. Available
services and messages are detailed in the [gRPC reference] pages.
[installation]: installation.md
[Getting started guide]: getting-started.md
[getting started guide]: getting-started.md
[client_example]: https://github.com/arduino/arduino-cli/blob/master/client_example
[gRPC reference]: rpc/commands
\ No newline at end of file
[grpc reference]: rpc/commands
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,8 @@
## Usage
In the source code, use the function `i18n.Tr("message", ...args)` to get a localized string. This tool parses the source using the `go/ast` package to generate the `en` locale using these messages.
In the source code, use the function `i18n.Tr("message", ...args)` to get a localized string. This tool parses the
source using the `go/ast` package to generate the `en` locale using these messages.
## Updating messages to reflect code changes
......@@ -25,11 +26,11 @@ task i18n:update
Set the following environment variables according to the project
|Variable|Description|
|--------|-----------|
|TRANSIFEX_PROJECT|Name of the transifex project|
|TRANSIFEX_RESOURCE|Name of the transifex translation resource|
|TRANSIFEX_API_KEY|API Key to access the transifex project|
| Variable | Description |
| ------------------ | ------------------------------------------ |
| TRANSIFEX_PROJECT | Name of the transifex project |
| TRANSIFEX_RESOURCE | Name of the transifex translation resource |
| TRANSIFEX_API_KEY | API Key to access the transifex project |
### Push
......
......@@ -6,7 +6,7 @@ site_url: https://arduino.github.io/arduino-cli/
# Repository
repo_name: arduino/arduino-cli
repo_url: https://github.com/arduino/arduino-cli
edit_uri: ''
edit_uri: ""
# Copyright
copyright: Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
......@@ -50,6 +50,9 @@ markdown_extensions:
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- mdx_truly_sane_lists:
nested_indent: 2
truly_sane: true
# Navigation
nav:
......@@ -60,48 +63,48 @@ nav:
- CONTRIBUTING.md
- FAQ.md
- Command reference:
- arduino-cli: commands/arduino-cli.md
- board: commands/arduino-cli_board.md
- board attach: commands/arduino-cli_board_attach.md
- board details: commands/arduino-cli_board_details.md
- board list: commands/arduino-cli_board_list.md
- board listall: commands/arduino-cli_board_listall.md
- burn-bootloader: commands/arduino-cli_burn-bootloader.md
- cache: commands/arduino-cli_cache.md
- cache clean: commands/arduino-cli_cache_clean.md
- compile: commands/arduino-cli_compile.md
- completion: commands/arduino-cli_completion.md
- config: commands/arduino-cli_config.md
- config dump: commands/arduino-cli_config_dump.md
- config init: commands/arduino-cli_config_init.md
- core: commands/arduino-cli_core.md
- core download: commands/arduino-cli_core_download.md
- core install: commands/arduino-cli_core_install.md
- core list: commands/arduino-cli_core_list.md
- core search: commands/arduino-cli_core_search.md
- core uninstall: commands/arduino-cli_core_uninstall.md
- core update index: commands/arduino-cli_core_update-index.md
- core upgrade: commands/arduino-cli_core_upgrade.md
- daemon: commands/arduino-cli_daemon.md
- debug: commands/arduino-cli_debug.md
- lib: commands/arduino-cli_lib.md
- lib deps: commands/arduino-cli_lib_deps.md
- lib download: commands/arduino-cli_lib_download.md
- lib install: commands/arduino-cli_lib_install.md
- lib list: commands/arduino-cli_lib_list.md
- lib search: commands/arduino-cli_lib_search.md
- lib uninstall: commands/arduino-cli_lib_uninstall.md
- lib update-index: commands/arduino-cli_lib_update-index.md
- lib upgrade: commands/arduino-cli_lib_upgrade.md
- sketch: commands/arduino-cli_sketch.md
- sketch new: commands/arduino-cli_sketch_new.md
- upload: commands/arduino-cli_upload.md
- version: commands/arduino-cli_version.md
- arduino-cli: commands/arduino-cli.md
- board: commands/arduino-cli_board.md
- board attach: commands/arduino-cli_board_attach.md
- board details: commands/arduino-cli_board_details.md
- board list: commands/arduino-cli_board_list.md
- board listall: commands/arduino-cli_board_listall.md
- burn-bootloader: commands/arduino-cli_burn-bootloader.md
- cache: commands/arduino-cli_cache.md
- cache clean: commands/arduino-cli_cache_clean.md
- compile: commands/arduino-cli_compile.md
- completion: commands/arduino-cli_completion.md
- config: commands/arduino-cli_config.md
- config dump: commands/arduino-cli_config_dump.md
- config init: commands/arduino-cli_config_init.md
- core: commands/arduino-cli_core.md
- core download: commands/arduino-cli_core_download.md
- core install: commands/arduino-cli_core_install.md
- core list: commands/arduino-cli_core_list.md
- core search: commands/arduino-cli_core_search.md
- core uninstall: commands/arduino-cli_core_uninstall.md
- core update index: commands/arduino-cli_core_update-index.md
- core upgrade: commands/arduino-cli_core_upgrade.md
- daemon: commands/arduino-cli_daemon.md
- debug: commands/arduino-cli_debug.md
- lib: commands/arduino-cli_lib.md
- lib deps: commands/arduino-cli_lib_deps.md
- lib download: commands/arduino-cli_lib_download.md
- lib install: commands/arduino-cli_lib_install.md
- lib list: commands/arduino-cli_lib_list.md
- lib search: commands/arduino-cli_lib_search.md
- lib uninstall: commands/arduino-cli_lib_uninstall.md
- lib update-index: commands/arduino-cli_lib_update-index.md
- lib upgrade: commands/arduino-cli_lib_upgrade.md
- sketch: commands/arduino-cli_sketch.md
- sketch new: commands/arduino-cli_sketch_new.md
- upload: commands/arduino-cli_upload.md
- version: commands/arduino-cli_version.md
- gRPC reference:
- commands: rpc/commands.md
- monitor: rpc/monitor.md
- settings: rpc/settings.md
- debug: rpc/debug.md
- commands: rpc/commands.md
- monitor: rpc/monitor.md
- settings: rpc/settings.md
- debug: rpc/debug.md
- configuration.md
- Integration options: integration-options.md
- sketch-build-process.md
......
......@@ -3,3 +3,4 @@ mkdocs-material<5
mike==0.5.1
gitpython
click<7.2
mdx_truly_sane_lists==1.2
# Integration tests
This dir contains integration tests, aimed to test the Command Line Interface
and its output from a pure user point of view.
This dir contains integration tests, aimed to test the Command Line Interface and its output from a pure user point of
view.
## Installation
......@@ -25,8 +25,8 @@ task test-integration
This will create and install all necessary dependencies if not already existing and then run integrations tests.
To run specific modules you must run `pytest` from the virtual environment created by Poetry.
If dependencies have not already been installed first run `poetry install`.
To run specific modules you must run `pytest` from the virtual environment created by Poetry. If dependencies have not
already been installed first run `poetry install`.
```shell
poetry run pytest test/test_lib.py
......@@ -54,7 +54,8 @@ To run lint check from the project's root folder:
task python:check
```
This will run `flake8` automatically and return any error in the code formatting, if not already installed it will also install integration tests dependencies.
This will run `flake8` automatically and return any error in the code formatting, if not already installed it will also
install integration tests dependencies.
In case of linting errors you should be able to solve most of them by automatically formatting with:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment