Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0c2c26f

Browse filesBrowse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
feat: adjust to new debug -I format in
- Adapt the debug launch config generation to the new CLI `debug --info --programmer` output, - Split up the extension code into modules, - Fixed security warnings, - Added integration tests, - Update CI workflow, - Generate schema and types for `cortex-debug`, - Validate `debug_custom.json`. Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 6b9ee4b commit 0c2c26f
Copy full SHA for 0c2c26f

39 files changed

+10560
-6531
lines changed

‎.eslintrc.js

Copy file name to clipboard
+41Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
parserOptions: {
4+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
5+
sourceType: 'module', // Allows for the use of imports
6+
},
7+
ignorePatterns: ['node_modules/*', '.github/*', '**/lib/*', '**/dist/*'],
8+
extends: [
9+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
10+
'plugin:prettier/recommended',
11+
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
12+
],
13+
plugins: ['prettier', 'unused-imports'],
14+
rules: {
15+
'@typescript-eslint/no-unused-expressions': 'off',
16+
'@typescript-eslint/no-namespace': 'off',
17+
'@typescript-eslint/no-var-requires': 'off',
18+
'@typescript-eslint/no-empty-function': 'warn',
19+
'@typescript-eslint/no-empty-interface': 'warn',
20+
'no-unused-vars': 'off',
21+
'unused-imports/no-unused-imports': 'error',
22+
'unused-imports/no-unused-vars': [
23+
'warn',
24+
{
25+
vars: 'all',
26+
varsIgnorePattern: '^_',
27+
args: 'after-used',
28+
argsIgnorePattern: '^_',
29+
},
30+
],
31+
eqeqeq: ['error', 'smart'],
32+
'guard-for-in': 'off',
33+
'id-blacklist': 'off',
34+
'id-match': 'off',
35+
'no-underscore-dangle': 'off',
36+
'no-unused-expressions': 'off',
37+
'no-var': 'error',
38+
radix: 'error',
39+
'prettier/prettier': 'warn',
40+
},
41+
};

‎.eslintrc.json

Copy file name to clipboardExpand all lines: .eslintrc.json
-18Lines changed: 0 additions & 18 deletions
This file was deleted.

‎.github/workflows/build.yml

Copy file name to clipboardExpand all lines: .github/workflows/build.yml
+30-9Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,40 @@ on:
55
branches:
66
- main
77

8+
env:
9+
# See: https://github.com/actions/setup-node/#readme
10+
NODE_VERSION: '18.17'
11+
812
jobs:
913
build:
10-
runs-on: ubuntu-latest
14+
name: Build (${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [windows-latest, ubuntu-latest, macos-latest]
19+
runs-on: ${{ matrix.os }}
1120
steps:
1221
- name: Checkout
13-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
1423

15-
- name: Install Node.js 12.x
16-
uses: actions/setup-node@v1
24+
- name: Install Node.js
25+
uses: actions/setup-node@v4
1726
with:
18-
node-version: "12.x"
19-
registry-url: "https://registry.npmjs.org"
27+
node-version: ${{ env.NODE_VERSION }}
28+
registry-url: 'https://registry.npmjs.org'
29+
cache: 'yarn'
2030

21-
- name: Build VS Code Extension
22-
run: |
23-
yarn
31+
- name: Install dependencies
32+
run: yarn
33+
# Fails if the generated schema is not under version control
34+
- name: Check schema
35+
run: yarn generate && git status -s && git diff --exit-code
36+
# Linux tests need a DISPLAY
37+
- name: Test
38+
if: runner.os == 'Linux'
39+
run: xvfb-run yarn test-all
40+
- name: Test
41+
if: runner.os != 'Linux'
42+
run: yarn test-all
43+
- name: Package
44+
run: yarn package

‎.github/workflows/deploy.yml

Copy file name to clipboardExpand all lines: .github/workflows/deploy.yml
+20-12Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,35 @@ name: Deploy
33
on:
44
push:
55
tags:
6-
- "*"
6+
- '*'
77
workflow_dispatch:
88
branches:
99
- main
1010

11+
env:
12+
# See: https://github.com/actions/setup-node/#readme
13+
NODE_VERSION: '18.17'
14+
1115
jobs:
1216
build:
1317
runs-on: ubuntu-latest
1418
steps:
1519
- name: Checkout
16-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
1721

18-
- name: Install Node.js 12.x
19-
uses: actions/setup-node@v1
22+
- name: Install Node.js
23+
uses: actions/setup-node@v4
2024
with:
21-
node-version: "12.x"
22-
registry-url: "https://registry.npmjs.org"
25+
node-version: ${{ env.NODE_VERSION }}
26+
registry-url: 'https://registry.npmjs.org'
27+
cache: 'yarn'
2328

24-
- name: Build VS Code Extension
25-
run: |
26-
yarn
29+
- name: Install dependencies
30+
run: yarn
31+
- name: Test
32+
run: yarn test
33+
- name: Package
34+
run: yarn package
2735

2836
- name: Upload VS Code Extension [GitHub Actions]
2937
uses: actions/upload-artifact@v2
@@ -34,9 +42,9 @@ jobs:
3442
- name: Upload VS Code Extension [S3]
3543
uses: docker://plugins/s3
3644
env:
37-
PLUGIN_SOURCE: "build-artifacts/*"
38-
PLUGIN_STRIP_PREFIX: "build-artifacts/"
39-
PLUGIN_TARGET: "/vscode-arduino-tools"
45+
PLUGIN_SOURCE: 'build-artifacts/*'
46+
PLUGIN_STRIP_PREFIX: 'build-artifacts/'
47+
PLUGIN_TARGET: '/vscode-arduino-tools'
4048
PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
4149
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
4250
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

‎.github/workflows/sync-labels.yml

Copy file name to clipboardExpand all lines: .github/workflows/sync-labels.yml
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ name: Sync Labels
55
on:
66
push:
77
paths:
8-
- ".github/workflows/sync-labels.ya?ml"
9-
- ".github/label-configuration-files/*.ya?ml"
8+
- '.github/workflows/sync-labels.ya?ml'
9+
- '.github/label-configuration-files/*.ya?ml'
1010
pull_request:
1111
paths:
12-
- ".github/workflows/sync-labels.ya?ml"
13-
- ".github/label-configuration-files/*.ya?ml"
12+
- '.github/workflows/sync-labels.ya?ml'
13+
- '.github/label-configuration-files/*.ya?ml'
1414
schedule:
1515
# Run daily at 8 AM UTC to sync with changes to shared label configurations.
16-
- cron: "0 8 * * *"
16+
- cron: '0 8 * * *'
1717
workflow_dispatch:
1818
repository_dispatch:
1919

@@ -27,11 +27,11 @@ jobs:
2727

2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v2
30+
uses: actions/checkout@v4
3131

3232
- name: Download JSON schema for labels configuration file
3333
id: download-schema
34-
uses: carlosperate/download-file-action@v1
34+
uses: carlosperate/download-file-action@v2
3535
with:
3636
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
3737
location: ${{ runner.temp }}/label-configuration-schema
@@ -66,7 +66,7 @@ jobs:
6666

6767
steps:
6868
- name: Download
69-
uses: carlosperate/download-file-action@v1
69+
uses: carlosperate/download-file-action@v2
7070
with:
7171
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
7272

@@ -106,16 +106,16 @@ jobs:
106106
echo "::set-output name=flag::--dry-run"
107107
108108
- name: Checkout repository
109-
uses: actions/checkout@v2
109+
uses: actions/checkout@v4
110110

111111
- name: Download configuration files artifact
112-
uses: actions/download-artifact@v2
112+
uses: actions/download-artifact@v3
113113
with:
114114
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
115115
path: ${{ env.CONFIGURATIONS_FOLDER }}
116116

117117
- name: Remove unneeded artifact
118-
uses: geekyeggo/delete-artifact@v1
118+
uses: geekyeggo/delete-artifact@v2
119119
with:
120120
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
121121

‎.gitignore

Copy file name to clipboard
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
.DS_Store
12
node_modules/
23
lib/
34
bin/
45
dist/
5-
build-artifacts/
6+
# build-artifacts/
7+
.tests/
8+
.vscode-test

‎.prettierignore

Copy file name to clipboard
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lib
2+
dist
3+
.vscode-test
4+
.tests

‎.prettierrc.json

Copy file name to clipboard
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"printWidth": 80,
6+
"endOfLine": "auto",
7+
"overrides": [
8+
{
9+
"files": "*.json",
10+
"options": {
11+
"tabWidth": 2
12+
}
13+
}
14+
]
15+
}

‎.vscode/extensions.json

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"amodio.tsl-problem-matcher",
5+
"streetsidesoftware.code-spell-checker"
6+
]
7+
}

‎.vscode/launch.json

Copy file name to clipboardExpand all lines: .vscode/launch.json
+35-7Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,47 @@
33
"version": "0.2.0",
44
"configurations": [
55
{
6-
"name": "Launch Arduino Tools – VS Code Extension",
6+
"name": "Run",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
10+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
11+
"preLaunchTask": "${defaultBuildTask}"
12+
},
13+
{
14+
"name": "Tests",
15+
"type": "extensionHost",
16+
"request": "launch",
17+
"args": [
18+
"--extensionDevelopmentPath=${workspaceFolder}",
19+
"--extensionTestsPath=${workspaceFolder}/lib/test/suite/index"
20+
],
21+
"env": {
22+
"NO_TEST_TIMEOUT": "true"
23+
},
24+
"outFiles": [
25+
"${workspaceFolder}/lib/**/*.js",
26+
"${workspaceFolder}/dist/**/*.js"
27+
],
28+
"preLaunchTask": "tasks: watch-tests"
29+
},
30+
{
31+
"name": "Slow Tests",
732
"type": "extensionHost",
833
"request": "launch",
9-
"runtimeExecutable": "${execPath}",
1034
"args": [
11-
"--extensionDevelopmentPath=${workspaceRoot}"
35+
"--extensionDevelopmentPath=${workspaceFolder}",
36+
"--extensionTestsPath=${workspaceFolder}/lib/test/suite/index"
1237
],
13-
"stopOnEntry": false,
14-
"sourceMaps": true,
38+
"env": {
39+
"NO_TEST_TIMEOUT": "true",
40+
"TEST_CONTEXT": "slow"
41+
},
1542
"outFiles": [
16-
"${workspaceRoot}/lib/**/*.js"
43+
"${workspaceFolder}/lib/**/*.js",
44+
"${workspaceFolder}/dist/**/*.js"
1745
],
18-
"preLaunchTask": "npm"
46+
"preLaunchTask": "tasks: watch-tests"
1947
}
2048
]
2149
}

‎.vscode/settings.json

Copy file name to clipboard
+5-14Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
{
2-
"tslint.configFile": "./tslint.json",
32
"files.exclude": {
43
"**/lib": false
54
},
6-
"editor.insertSpaces": true,
7-
"editor.detectIndentation": false,
8-
"[typescript]": {
9-
"editor.tabSize": 4
10-
},
11-
"[json]": {
12-
"editor.tabSize": 2
13-
},
14-
"[jsonc]": {
15-
"editor.tabSize": 2
16-
},
17-
"files.insertFinalNewline": true,
18-
"typescript.tsdk": "node_modules/typescript/lib"
5+
"typescript.tsc.autoDetect": "off",
6+
"typescript.tsdk": "node_modules/typescript/lib",
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll.eslint": true
9+
}
1910
}

‎.vscode/tasks.json

Copy file name to clipboard
+32-7Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
{
22
"version": "2.0.0",
3-
"command": "npm",
4-
"args": [
5-
"run",
6-
"compile"
7-
],
8-
"isBackground": true,
9-
"problemMatcher": "$tsc-watch"
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "watch",
7+
"problemMatcher": "$ts-webpack-watch",
8+
"isBackground": true,
9+
"presentation": {
10+
"reveal": "never",
11+
"group": "watchers"
12+
},
13+
"group": {
14+
"kind": "build",
15+
"isDefault": true
16+
}
17+
},
18+
{
19+
"type": "npm",
20+
"script": "watch-tests",
21+
"problemMatcher": "$tsc-watch",
22+
"isBackground": true,
23+
"presentation": {
24+
"reveal": "never",
25+
"group": "watchers"
26+
},
27+
"group": "build"
28+
},
29+
{
30+
"label": "tasks: watch-tests",
31+
"dependsOn": ["npm: watch", "npm: watch-tests"],
32+
"problemMatcher": []
33+
}
34+
]
1035
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.