From a5d8222cf90b279312b42ee4eb826fbf691e2b87 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 26 Sep 2023 10:58:44 -0400 Subject: [PATCH 1/3] Add whitelist to configuration documentation It may be unclear to users that the whitelist is configurable by adding it to the `paths` variable in pyproject.toml (see https://github.com/jendrikseipp/vulture/issues/327). Adding it into the example configuration should make this more obvious. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64ccf7b7..7d593526 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ ignore_decorators = ["@app.route", "@require_*"] ignore_names = ["visit_*", "do_*"] make_whitelist = true min_confidence = 80 -paths = ["myscript.py", "mydir"] +paths = ["myscript.py", "mydir", "whitelist.py"] sort_by_size = true verbose = true ``` From 685073cf2d7ed1a398562254f2790479d687f498 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 26 Sep 2023 11:04:19 -0400 Subject: [PATCH 2/3] Add whitelsit in paths note It may be unclear to users that the whitelist is configurable by adding it to the `paths` variable in pyproject.toml (see https://github.com/jendrikseipp/vulture/issues/327). Adding an explicit note about this should help. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 7d593526..6c8bd679 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,13 @@ makes Vulture ignore the `greet` method: dead_code.py:1: unused import 'os' (90% confidence) dead_code.py:8: unused variable 'message' (60% confidence) +If you'd like Vulture to use the whitelist file any time it is invoked, it can +be added to the `paths` variable in the `pyproject.toml`: + + [tool.vulture] + paths = ["myscript.py", "mydir", "whitelist_dead_code.py"] + +