File tree Expand file tree Collapse file tree 4 files changed +27
-15
lines changed Expand file tree Collapse file tree 4 files changed +27
-15
lines changed Original file line number Diff line number Diff line change 26
26
" esbenp.prettier-vscode" ,
27
27
" streetsidesoftware.code-spell-checker" ,
28
28
" timonwong.shellcheck"
29
- ],
30
- "settings" : {
31
- "rust-analyzer.server.path" : " /workspaces/slang/bin/rust-analyzer"
32
- }
29
+ ]
33
30
}
Original file line number Diff line number Diff line change 2
2
"editor.formatOnSave" : true ,
3
3
"editor.rulers" : [120 ],
4
4
"files.eol" : " \n " ,
5
+ "rust-analyzer.server.path" : " ${workspaceFolder}/bin/rust-analyzer" ,
5
6
"search.exclude" : {
6
7
"**/.hermit/" : true ,
7
8
"**/generated/" : true ,
Original file line number Diff line number Diff line change @@ -17,5 +17,23 @@ function _list_source_files() {
17
17
pattern=" $1 "
18
18
19
19
cd " $REPO_ROOT "
20
- rg --files --hidden --sort " path" --glob ' !.git/**' --glob " $pattern " | xargs realpath --canonicalize-existing
20
+ rg \
21
+ --files --sort " path" \
22
+ --hidden --glob ' !.git/**' --glob ' !.hermit/**' \
23
+ --glob " $pattern " \
24
+ | xargs realpath --canonicalize-existing
25
+ }
26
+
27
+ #
28
+ # Optionally appends an argument to a string if it doesn't already contain it.
29
+ #
30
+ function _try_append_arg() {
31
+ original=" $1 "
32
+ arg=" $2 "
33
+
34
+ if [[ " $original " == * " $arg " * ]]; then
35
+ echo " $original "
36
+ else
37
+ echo " $original $arg "
38
+ fi
21
39
}
Original file line number Diff line number Diff line change @@ -7,19 +7,15 @@ source "$(dirname "${BASH_SOURCE[0]}")/../_common.sh"
7
7
# Enable stack traces for any errors
8
8
export RUST_BACKTRACE=" full"
9
9
10
+ RUSTFLAGS=" ${RUSTFLAGS:- } "
11
+ RUSTFLAGS=" $( _try_append_arg " $RUSTFLAGS " " --warn unused_crate_dependencies" ) "
12
+
10
13
if [[ " ${CI:- } " ]]; then
11
14
# Strict checks for CI
12
- declare -a rust_flags=(
13
- " ${RUSTFLAGS:- } "
14
- " --warn unused_crate_dependencies"
15
- " --deny warnings"
16
- )
15
+ RUSTFLAGS=" $( _try_append_arg " $RUSTFLAGS " " --deny warnings" ) "
17
16
else
18
17
# Optimizations for local development
19
- declare -a rust_flags=(
20
- " ${RUSTFLAGS:- } "
21
- " --codegen target-cpu=native"
22
- )
18
+ RUSTFLAGS=" $( _try_append_arg " $RUSTFLAGS " " --codegen target-cpu=native" ) "
23
19
fi
24
20
25
- export RUSTFLAGS= " ${rust_flags[*]} "
21
+ export RUSTFLAGS
You can’t perform that action at this time.
0 commit comments