Skip to content

Commit 451f070

Browse files
add settings for editors and github workflow
1 parent 9570457 commit 451f070

15 files changed

Lines changed: 236 additions & 97 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
### Pull Request Overview
2+
3+
This pull request adds/changes/fixes...
4+
5+
6+
### Testing Strategy
7+
8+
This pull request was tested by...
9+
10+
11+
### TODO or Help Wanted
12+
13+
This pull request still needs...
14+
15+
16+
### Build
17+
18+
- [ ] Ran `cargo fmt`.
19+
- [ ] Ran `cargo build`.
20+
- [ ] Ran `cargo clippy`.
21+
22+
### Author
23+
24+
Signed-off-by: Your Name <your.email@example.com>

.github/workflows/rust.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
pull_request:
6+
merge_group:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Format
18+
run: |
19+
cd device
20+
for package in $(ls -d usb*); do
21+
cargo fmt --check
22+
done
23+
cd ..
24+
cd host/usb-bulk-rust
25+
cargo fmt --check
26+
- name: Build
27+
run: |
28+
cd device
29+
for package in $(ls -d usb*); do
30+
(cd $package && cargo build)
31+
done
32+
cd ..
33+
cd host/usb-bulk-rust
34+
cargo build
35+
- name: Clippy
36+
run: |
37+
cd device
38+
for package in $(ls -d lab*); do
39+
(cd $package && cargo clippy)
40+
done
41+
cd ..
42+
cd host/usb-bulk-rust
43+
cargo clippy
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[[language]]
2+
name = "rust"
3+
language-servers = ["rust-analyzer"]
4+
5+
[language-server.rust-analyzer.config]
6+
check = { allTargets = false }
7+
cargo = { target = "thumbv8m.main-none-eabihf" }
8+
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"version": "0.2.0",
3-
"configurations": [
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"preLaunchTask": "rust: cargo build",
6+
"type": "probe-rs-debug",
7+
"request": "launch",
8+
"name": "Raspberry Pi Pico 2",
9+
"cwd": "${workspaceFolder}",
10+
"connectUnderReset": false,
11+
"chip": "RP235x",
12+
"flashingConfig": {
13+
"flashingEnabled": true,
14+
"haltAfterReset": false
15+
},
16+
"coreConfigs": [
417
{
5-
"preLaunchTask": "rust: cargo build",
6-
"type": "probe-rs-debug",
7-
"request": "launch",
8-
"name": "Raspberry Pi Pico 2",
9-
"cwd": "${workspaceFolder}",
10-
"connectUnderReset": false,
11-
"chip": "RP235x",
12-
"flashingConfig": {
13-
"flashingEnabled": true,
14-
"haltAfterReset": false,
15-
},
16-
"coreConfigs": [
17-
{
18-
"coreIndex": 0,
19-
"programBinary": "./target/thumbv8m.main-none-eabihf/debug/${workspaceFolderBasename}",
20-
"svdFile": "./rp2350.svd",
21-
"rttEnabled": true,
22-
}
23-
]
18+
"coreIndex": 0,
19+
"programBinary": "./target/thumbv8m.main-none-eabihf/debug/${workspaceFolderBasename}",
20+
"svdFile": "./rp2350.svd",
21+
"rttEnabled": true
2422
}
25-
]
26-
}
23+
]
24+
}
25+
]
26+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"rust-analyzer.check.allTargets": false,
3-
"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf",
4-
"editor.formatOnSave": true,
5-
"editor.formatOnSaveMode": "file",
6-
}
2+
"rust-analyzer.check.allTargets": false,
3+
"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf",
4+
"editor.formatOnSave": true,
5+
"editor.formatOnSaveMode": "file"
6+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"lsp": {
3+
"rust-analyzer": {
4+
"initialization_options": {
5+
"cargo": {
6+
"allTargets": false
7+
},
8+
"check": {
9+
"workspace": false
10+
}
11+
}
12+
}
13+
},
14+
"inlay_hints": {
15+
"enabled": true
16+
}
17+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[[language]]
2+
name = "rust"
3+
language-servers = ["rust-analyzer"]
4+
5+
[language-server.rust-analyzer.config]
6+
check = { allTargets = false }
7+
cargo = { target = "thumbv7em-none-eabi" }
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"version": "0.2.0",
3-
"configurations": [
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"preLaunchTask": "rust: cargo build",
6+
"type": "probe-rs-debug",
7+
"request": "launch",
8+
"name": "STM32 Nucleu F429ZI",
9+
"cwd": "${workspaceFolder}",
10+
"connectUnderReset": false,
11+
"chip": "STM32F429ZITx",
12+
"flashingConfig": {
13+
"flashingEnabled": true,
14+
"haltAfterReset": false
15+
},
16+
"coreConfigs": [
417
{
5-
"preLaunchTask": "rust: cargo build",
6-
"type": "probe-rs-debug",
7-
"request": "launch",
8-
"name": "STM32 Nucleu F429ZI",
9-
"cwd": "${workspaceFolder}",
10-
"connectUnderReset": false,
11-
"chip": "STM32F429ZITx",
12-
"flashingConfig": {
13-
"flashingEnabled": true,
14-
"haltAfterReset": false,
15-
},
16-
"coreConfigs": [
17-
{
18-
"coreIndex": 0,
19-
"programBinary": "./target/thumbv8m.main-none-eabihf/debug/${workspaceFolderBasename}",
20-
"svdFile": "./stm32f429zi.svd",
21-
"rttEnabled": true,
22-
}
23-
]
18+
"coreIndex": 0,
19+
"programBinary": "./target/thumbv8m.main-none-eabihf/debug/${workspaceFolderBasename}",
20+
"svdFile": "./stm32f429zi.svd",
21+
"rttEnabled": true
2422
}
25-
]
26-
}
23+
]
24+
}
25+
]
26+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"rust-analyzer.check.allTargets": false,
3-
"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf",
4-
"editor.formatOnSave": true,
5-
"editor.formatOnSaveMode": "file",
6-
}
2+
"rust-analyzer.check.allTargets": false,
3+
"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf",
4+
"editor.formatOnSave": true,
5+
"editor.formatOnSaveMode": "file"
6+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"lsp": {
3+
"rust-analyzer": {
4+
"initialization_options": {
5+
"cargo": {
6+
"allTargets": false
7+
},
8+
"check": {
9+
"workspace": false
10+
}
11+
}
12+
}
13+
},
14+
"inlay_hints": {
15+
"enabled": true
16+
}
17+
}

0 commit comments

Comments
 (0)