File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ ${CI_RETRY_EXE} pip3 install codespell==2.0.0
15
15
${CI_RETRY_EXE} pip3 install flake8==3.8.3
16
16
${CI_RETRY_EXE} pip3 install yq
17
17
${CI_RETRY_EXE} pip3 install mypy==0.781
18
+ ${CI_RETRY_EXE} pip3 install vulture==2.3
18
19
19
20
SHELLCHECK_VERSION=v0.7.1
20
21
curl -sL " https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION} /shellcheck-${SHELLCHECK_VERSION} .linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Copyright (c) 2021 The Bitcoin Core developers
4
+ # Distributed under the MIT software license, see the accompanying
5
+ # file COPYING or http://www.opensource.org/licenses/mit-license.php.
6
+ #
7
+ # Find dead Python code.
8
+
9
+ export LC_ALL=C
10
+
11
+ if ! command -v vulture > /dev/null; then
12
+ echo " Skipping Python dead code linting since vulture is not installed. Install by running \" pip3 install vulture\" "
13
+ exit 0
14
+ fi
15
+
16
+ # --min-confidence 100 will only report code that is guaranteed to be unused within the analyzed files.
17
+ # Any value below 100 introduces the risk of false positives, which would create an unacceptable maintenance burden.
18
+ if ! vulture \
19
+ --min-confidence 100 \
20
+ $( git ls-files -- " *.py" ) ; then
21
+ echo " Python dead code detection found some issues"
22
+ exit 1
23
+ fi
You can’t perform that action at this time.
0 commit comments