Skip to content

Commit 02416e7

Browse files
[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: per1234 <[email protected]> * [skip changelog] Format PR and issues templates * [skip changelog] Format files after rebase * [skip changelog] Update .prettierrc and reformat everything Co-authored-by: per1234 <[email protected]>
1 parent 8449ac1 commit 02416e7

36 files changed

+1320
-999
lines changed

.dependabot/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ update_configs:
77
- match:
88
update_type: "security"
99
default_labels:
10-
- "component/dependencies"
10+
- "component/dependencies"

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ indent_size = 4
1515
indent_style = space
1616
indent_size = 4
1717

18-
[*.yml,*.tmpl]
18+
[*.yml,*.yaml,*.tmpl]
1919
indent_style = space
2020
indent_size = 2
2121

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
---
22
name: 🐛 Bug Report
33
about: If something isn't working as expected 🤔.
4-
54
---
65

76
## Bug Report
87

98
### Current behavior
10-
<!-- Paste the full command you run -->
119

10+
<!-- Paste the full command you run -->
1211

1312
<!-- Add a clear and concise description of the behavior. -->
1413

15-
1614
### Expected behavior
17-
<!-- Add a clear and concise description of what you expected to happen. -->
1815

16+
<!-- Add a clear and concise description of what you expected to happen. -->
1917

2018
### Environment
2119

2220
- CLI version (output of `arduino-cli version`):
2321
- OS and platform:
2422

2523
### Additional context
24+
2625
<!-- (Optional) Add any other context about the problem here. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
**Please check if the PR fulfills these requirements**
2-
- [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-cli/pulls) before creating one)
2+
3+
- [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-cli/pulls)
4+
before creating one)
35
- [ ] The PR follows [our contributing guidelines](https://arduino.github.io/arduino-cli/CONTRIBUTING/#pull-requests)
46
- [ ] Tests for the changes have been added (for bug fixes / features)
57
- [ ] Docs have been added / updated (for bug fixes / features)
68

7-
89
* **What kind of change does this PR introduce?**
910
<!-- Bug fix, feature, docs update, ... -->
1011

11-
12-
* **What is the current behavior?**
12+
- **What is the current behavior?**
1313
<!-- You can also link to an open issue here -->
1414

15-
1615
* **What is the new behavior?**
1716
<!-- if this is a feature change -->
1817

19-
20-
21-
* **Does this PR introduce a breaking change?**
18+
- **Does this PR introduce a breaking change?**
2219
<!-- What changes might users need to make in their workflow or application due to this PR? -->
2320

24-
25-
2621
* **Other information**:
2722
<!-- Any additional information that could help the review process -->
2823

29-
3024
---
25+
3126
See [how to contribute](https://arduino.github.io/arduino-cli/CONTRIBUTING/)

.github/workflows/arduino-stats.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: arduino-stats
33
on:
44
schedule:
55
# run every day at 12:30:00
6-
- cron: '30 12 * * *'
6+
- cron: "30 12 * * *"
77

88
jobs:
99
push-stats:

.github/workflows/docs.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ on:
44
pull_request:
55
paths:
66
# existing docs
7-
- 'docs/**'
7+
- "docs/**"
88
# changes to the cli reference generator
9-
- 'docsgen/**'
9+
- "docsgen/**"
1010
# potential changes to commands documentation
11-
- 'cli/**'
11+
- "cli/**"
1212
# potential changes to gRPC documentation
13-
- 'rpc/**'
13+
- "rpc/**"
1414
# changes to the workflow itself
15-
- '.github/workflows/docs.yaml'
15+
- ".github/workflows/docs.yaml"
1616
push:
1717
branches:
1818
- master
1919
# release branches have names like 0.8.x, 0.9.x, ...
20-
- '[0-9]+.[0-9]+.x'
20+
- "[0-9]+.[0-9]+.x"
2121
# At this day, GitHub doesn't support YAML anchors, d'oh!
2222
paths:
23-
- 'docs/**'
24-
- 'docsgen/**'
25-
- 'cli/**'
26-
- 'rpc/**'
27-
- '.github/workflows/docs.yaml'
23+
- "docs/**"
24+
- "docsgen/**"
25+
- "cli/**"
26+
- "rpc/**"
27+
- ".github/workflows/docs.yaml"
2828

2929
jobs:
3030
build:
@@ -42,7 +42,7 @@ jobs:
4242
- name: Setup Go
4343
uses: actions/setup-go@v2-beta
4444
with:
45-
go-version: '1.14'
45+
go-version: "1.14"
4646

4747
- name: Install Go dependencies
4848
run: |
@@ -57,8 +57,8 @@ jobs:
5757
- name: Setup Python
5858
uses: actions/setup-python@v1
5959
with:
60-
python-version: '3.6'
61-
architecture: 'x64'
60+
python-version: "3.6"
61+
architecture: "x64"
6262

6363
- name: Cache dependencies
6464
uses: actions/cache@v1

.github/workflows/github-stats.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: github-stats
33
on:
44
schedule:
55
# run every 30 minutes
6-
- cron: '*/30 * * * *'
6+
- cron: "*/30 * * * *"
77

88
jobs:
99
push-stats:

.github/workflows/i18n-nightly-push.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: i18n-nightly-push
33
on:
44
schedule:
55
# run every day at 1AM
6-
- cron: '0 1 * * *'
6+
- cron: "0 1 * * *"
77

88
jobs:
99
push-to-transifex:
@@ -15,7 +15,7 @@ jobs:
1515
- name: Install Go
1616
uses: actions/setup-go@v2
1717
with:
18-
go-version: '1.14'
18+
go-version: "1.14"
1919

2020
- name: Install Taskfile
2121
uses: Arduino/actions/setup-taskfile@master
@@ -27,4 +27,4 @@ jobs:
2727
env:
2828
TRANSIFEX_PROJECT: ${{ secrets.TRANSIFEX_PROJECT }}
2929
TRANSIFEX_RESOURCE: ${{ secrets.TRANSIFEX_RESOURCE }}
30-
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}
30+
TRANSIFEX_API_KEY: ${{ secrets.TRANSIFEX_API_KEY }}

.github/workflows/i18n-weekly-pull.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: i18n-weekly-pull
33
on:
44
schedule:
55
# run every monday at 2AM
6-
- cron: '0 2 * * 1'
6+
- cron: "0 2 * * 1"
77

88
jobs:
99
pull-from-transifex:
@@ -15,7 +15,7 @@ jobs:
1515
- name: Install Go
1616
uses: actions/setup-go@v2
1717
with:
18-
go-version: '1.14'
18+
go-version: "1.14"
1919

2020
- name: Install Go deps
2121
run: |
@@ -38,4 +38,4 @@ jobs:
3838
with:
3939
commit-message: Updated translation files
4040
title: Updated translation files
41-
branch: i18n/translations-update
41+
branch: i18n/translations-update

.github/workflows/nightly.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name: nightly
33
on:
44
schedule:
55
# run every day at 1AM
6-
- cron: '0 1 * * *'
6+
- cron: "0 1 * * *"
77

88
jobs:
9-
109
create-nightly-artifacts:
1110
runs-on: ubuntu-latest
1211

@@ -94,9 +93,9 @@ jobs:
9493
- name: upload
9594
uses: docker://plugins/s3
9695
env:
97-
PLUGIN_SOURCE: 'dist/*'
98-
PLUGIN_TARGET: '/arduino-cli/nightly'
99-
PLUGIN_STRIP_PREFIX: 'dist/'
96+
PLUGIN_SOURCE: "dist/*"
97+
PLUGIN_TARGET: "/arduino-cli/nightly"
98+
PLUGIN_STRIP_PREFIX: "dist/"
10099
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
101100
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
102101
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

.github/workflows/release.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name: release
33
on:
44
push:
55
tags:
6-
- '[0-9]+.[0-9]+.[0-9]+*'
6+
- "[0-9]+.[0-9]+.[0-9]+*"
77

88
jobs:
9-
109
create-release-artifacts:
1110
runs-on: ubuntu-latest
1211

@@ -134,9 +133,9 @@ jobs:
134133
- name: Upload release files on Arduino downloads servers
135134
uses: docker://plugins/s3
136135
env:
137-
PLUGIN_SOURCE: 'dist/*'
138-
PLUGIN_TARGET: '/arduino-cli/'
139-
PLUGIN_STRIP_PREFIX: 'dist/'
136+
PLUGIN_SOURCE: "dist/*"
137+
PLUGIN_TARGET: "/arduino-cli/"
138+
PLUGIN_STRIP_PREFIX: "dist/"
140139
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
141140
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
142141
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

.github/workflows/stale.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: stale-bot
33
on:
44
schedule:
55
# run every day at midnight
6-
- cron: '0 0 * * *'
6+
- cron: "0 0 * * *"
77
issue_comment:
8-
types: ['created']
8+
types: ["created"]
99

1010
jobs:
1111
stale-bot:

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install Go
3131
uses: actions/setup-go@v2
3232
with:
33-
go-version: '1.14'
33+
go-version: "1.14"
3434

3535
- name: Install Go deps
3636
# Since 10/23/2019 pwsh is the default shell
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Verify files formatting"
2+
3+
on:
4+
push:
5+
paths:
6+
- "**/*.md"
7+
- "**/*.yml"
8+
- "**/*.yaml"
9+
- ".prettierrc"
10+
- ".prettierignore"
11+
pull_request:
12+
paths:
13+
- "**/*.md"
14+
- "**/*.yml"
15+
- "**/*.yaml"
16+
- ".prettierrc"
17+
- ".prettierignore"
18+
19+
jobs:
20+
verify-formatting:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@master
26+
27+
- name: Install Taskfile
28+
uses: Arduino/actions/setup-taskfile@master
29+
with:
30+
repo-token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Verify formatting of all files
33+
run: task docs:check config:check

.goreleaser.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ changelog:
1919
# We have multiple builds in order to fine tune
2020
# cross compilations.
2121
builds:
22-
-
23-
# OSX
22+
- # OSX
2423
id: arduino_cli_osx
2524
binary: arduino-cli
2625
env:
@@ -33,8 +32,7 @@ builds:
3332
- amd64
3433
ldflags:
3534
- -s -w -X github.com/arduino/arduino-cli/version.versionString={{.Tag}} -X github.com/arduino/arduino-cli/version.commit={{ .ShortCommit }}
36-
-
37-
# ARM
35+
- # ARM
3836
id: arduino_cli_arm
3937
binary: arduino-cli
4038
env:
@@ -49,8 +47,7 @@ builds:
4947
ldflags:
5048
- -s -w -X github.com/arduino/arduino-cli/version.versionString={{.Tag}} -X github.com/arduino/arduino-cli/version.commit={{ .ShortCommit }}
5149
- "-extldflags '-static'"
52-
-
53-
# ARMv7
50+
- # ARMv7
5451
id: arduino_cli_armv7
5552
binary: arduino-cli
5653
env:
@@ -65,8 +62,7 @@ builds:
6562
ldflags:
6663
- -s -w -X github.com/arduino/arduino-cli/version.versionString={{.Tag}} -X github.com/arduino/arduino-cli/version.commit={{ .ShortCommit }}
6764
- "-extldflags '-static'"
68-
-
69-
# ARM64
65+
- # ARM64
7066
id: arduino_cli_arm64
7167
binary: arduino-cli
7268
env:
@@ -79,8 +75,7 @@ builds:
7975
ldflags:
8076
- -s -w -X github.com/arduino/arduino-cli/version.versionString={{.Tag}} -X github.com/arduino/arduino-cli/version.commit={{ .ShortCommit }}
8177
- "-extldflags '-static'"
82-
-
83-
# All the other platforms
78+
- # All the other platforms
8479
id: arduino_cli
8580
binary: arduino-cli
8681
env:
@@ -96,8 +91,7 @@ builds:
9691
- "-extldflags '-static'"
9792

9893
archives:
99-
-
100-
id: "arduino_cli"
94+
- id: "arduino_cli"
10195
format: tar.gz
10296
format_overrides:
10397
- goos: windows

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# IDE files
2+
.idea/
3+
.vscode/
4+
.vs/
5+
.ionide/

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"semi": false,
3+
"printWidth": 120,
4+
"overrides": [
5+
{
6+
"files": "*.md",
7+
"options": {
8+
"proseWrap": "always"
9+
}
10+
}
11+
]
12+
}

0 commit comments

Comments
 (0)