This repository was archived by the owner on Nov 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 1111 "files.watcherExclude" : {
1212 "**/target/**" : true
1313 },
14- "rust-analyzer.checkOnSave.command" : " clippy"
14+ "rust-analyzer.checkOnSave.command" : " clippy" ,
15+ "rust-analyzer.linkedProjects" : [
16+ " /workspaces/onefuzz/src/agent/Cargo.toml"
17+ ],
18+ "python.defaultInterpreterPath" : " /workspaces/onefuzz/src/venv/bin/python"
1519 },
1620 // Add the IDs of extensions you want installed when the container is created.
1721 "extensions" : [
Original file line number Diff line number Diff line change @@ -58,3 +58,6 @@ pip install -r requirements.txt
5858cd /workspaces/onefuzz/src/utils
5959chmod u+x lint.sh
6060pip install types-six
61+
62+ cp /workspaces/onefuzz/.devcontainer/pre-commit /workspaces/onefuzz/.git/hooks
63+ chmod u+x /workspaces/onefuzz/.git/hooks/pre-commit
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " Formatting..."
4+ dotnetFormatted=0
5+ rustFormatted=0
6+ pythonFormatted=0
7+
8+ for f in $( git diff --name-only --diff-filter=ACM)
9+ do
10+ if [[ $dotnetFormatted == 0 ]] && [[ $f == src/ApiService/* ]]; then
11+ echo " Formatting dotnet"
12+ cd /workspaces/onefuzz/src/ApiService
13+ dotnet format
14+ dotnetFormatted=1
15+ fi
16+
17+ if [[ $rustFormatted == 0 ]] && [[ $f == src/agent/* ]]; then
18+ echo " Formatting rust"
19+ cd /workspaces/onefuzz/src/agent
20+ cargo fmt
21+ rustFormatted=1
22+ fi
23+
24+ if [[ $pythonFormatted == 0 ]] && [[ $( grep -Eq ' src/(cli|api-service|pytypes)/*' <<< $f ) ]]; then
25+ echo " Formatting python"
26+ cd /workspaces/onefuzz/src/utils
27+ ./lint.sh
28+ pythonFormatted=1
29+ fi
30+
31+ if [[ $dotnetFormatted == 1 ]] && [[ $rustFormatted == 1 ]] && [[ $pythonFormatted == 1 ]]; then
32+ break
33+ fi
34+ done
35+
36+ echo " Done formatting"
You can’t perform that action at this time.
0 commit comments