File tree Expand file tree Collapse file tree 6 files changed +44
-5
lines changed Expand file tree Collapse file tree 6 files changed +44
-5
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,9 @@ source ./.evergreen/env.sh
8
8
CLIPPY_VERSION=1.75.0
9
9
10
10
rustup install $CLIPPY_VERSION
11
- cargo install clippy-sarif
12
11
13
12
# Check with default features.
14
13
cargo +$CLIPPY_VERSION clippy --all-targets -p mongodb -- -D warnings
15
14
16
15
# Check with all features.
17
- cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p mongodb -- -D warnings
18
-
19
- # Produce a SARIF report.
20
- cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p mongodb --message-format=json -- -D warnings | clippy-sarif > clippy.sarif.json
16
+ cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p mongodb -- -D warnings
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -o errexit
4
+
5
+ source ./.evergreen/env.sh
6
+
7
+ . ${DRIVERS_TOOLS} /.evergreen/find-python3.sh
8
+ PYTHON=$( find_python3)
9
+
10
+ if [[ -f " semgrep/bin/activate" ]]; then
11
+ echo ' using existing virtualenv'
12
+ . semgrep/bin/activate
13
+ else
14
+ echo ' Creating new virtualenv'
15
+ ${PYTHON} -m venv semgrep
16
+ echo ' Activating new virtualenv'
17
+ . semgrep/bin/activate
18
+ python3 -m pip install semgrep
19
+ fi
20
+
21
+ # Generate a SARIF report
22
+ semgrep --config p/rust --sarif > mongo-rust-driver.json.sarif
23
+ # And human-readable output
24
+ semgrep --config p/rust --error
Original file line number Diff line number Diff line change @@ -699,6 +699,11 @@ tasks:
699
699
commands :
700
700
- func : " check clippy"
701
701
702
+ - name : check-semgrep
703
+ tags : [lint]
704
+ commands :
705
+ - func : " check semgrep"
706
+
702
707
- name : check-rustdoc
703
708
tags : [lint]
704
709
commands :
@@ -1821,6 +1826,16 @@ functions:
1821
1826
${PREPARE_SHELL}
1822
1827
.evergreen/check-clippy.sh
1823
1828
1829
+ " check semgrep " :
1830
+ - command : subprocess.exec
1831
+ type : test
1832
+ params :
1833
+ working_dir : src
1834
+ add_expansions_to_env : true
1835
+ binary : bash
1836
+ args :
1837
+ - .evergreen/check-semgrep.sh
1838
+
1824
1839
" check rustdoc " :
1825
1840
- command : shell.exec
1826
1841
type : test
Original file line number Diff line number Diff line change
1
+ benchmarks/
2
+ src/test/
Original file line number Diff line number Diff line change @@ -316,6 +316,7 @@ impl ScramVersion {
316
316
) -> Result < Vec < u8 > > {
317
317
let normalized_password = match self {
318
318
ScramVersion :: Sha1 => {
319
+ // nosemgrep: insecure-hashes
319
320
let mut md5 = Md5 :: new ( ) ;
320
321
md5. update ( format ! ( "{}:mongo:{}" , username, password) ) ;
321
322
Cow :: Owned ( hex:: encode ( md5. finalize ( ) ) )
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ fn make_rustls_config(cfg: TlsOptions) -> Result<rustls::ClientConfig> {
142
142
} ;
143
143
144
144
if let Some ( true ) = cfg. allow_invalid_certificates {
145
+ // nosemgrep: rustls-dangerous
145
146
config
146
147
. dangerous ( )
147
148
. set_certificate_verifier ( Arc :: new ( NoCertVerifier { } ) ) ;
You can’t perform that action at this time.
0 commit comments