From b41a2f2366a4385e68603c6348b7990cd46775b2 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 3 May 2021 13:05:42 -0400 Subject: [PATCH] travis: Fail build if vulture finds dead code --- .travis.yml | 3 +++ monkey/monkey_island/Pipfile | 1 + monkey/monkey_island/Pipfile.lock | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b3f1e7428..8c7acfc3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,6 +63,9 @@ script: ## Check that all python is properly formatted. Fail otherwise. - python -m black --check . +## Check that there is no dead python code +- python -m vulture . + ## Run unit tests and generate coverage data - cd monkey # This is our source dir - python -m pytest --cov=. # Have to use `python -m pytest` instead of `pytest` to add "{$builddir}/monkey/monkey" to sys.path. diff --git a/monkey/monkey_island/Pipfile b/monkey/monkey_island/Pipfile index 65eeaae4b..212e08e86 100644 --- a/monkey/monkey_island/Pipfile +++ b/monkey/monkey_island/Pipfile @@ -42,6 +42,7 @@ flake8 = "==3.9.0" pytest-cov = "*" isort = "==5.8.0" coverage = "*" +vulture = "==2.3" [requires] python_version = "3.7" diff --git a/monkey/monkey_island/Pipfile.lock b/monkey/monkey_island/Pipfile.lock index 46479e643..7e9f1be72 100644 --- a/monkey/monkey_island/Pipfile.lock +++ b/monkey/monkey_island/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3057235b1e85593ee307d9e5a2e0d15e26f13437bb709529303c7c900d3c7b41" + "sha256": "6734e0c45321194a1ec4ac2e91af8efb9b9dd9e7f02af146d01219dc64847a51" }, "pipfile-spec": 6, "requires": { @@ -1447,6 +1447,14 @@ "index": "pypi", "version": "==20.4.3" }, + "vulture": { + "hashes": [ + "sha256:03d5a62bcbe9ceb9a9b0575f42d71a2d414070229f2e6f95fa6e7c71aaaed967", + "sha256:f39de5e6f1df1f70c3b50da54f1c8d494159e9ca3d01a9b89eac929600591703" + ], + "index": "pypi", + "version": "==2.3" + }, "zipp": { "hashes": [ "sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76",