From 34e93b02043c4ea14dd465ad491363b3b6c860ae Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Sat, 11 Jun 2022 21:48:14 +1000 Subject: [PATCH] Add whitelist for the pint package (#258). --- CHANGELOG.md | 2 ++ tox.ini | 1 + vulture/whitelists/pint_whitelist.py | 4 ++++ 3 files changed, 7 insertions(+) create mode 100644 vulture/whitelists/pint_whitelist.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f0f2bb..4d301d9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Add whitelist for `pint.UnitRegistry.default_formatter` (Ben Elliston, #258). + # 2.4 (2022-05-19) * Print absolute filepaths as relative again (as in version 2.1 and before) diff --git a/tox.ini b/tox.ini index 3ff0d59a..57ba68b9 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,7 @@ commands = [testenv] deps = coverage + pint pytest pytest-cov commands = diff --git a/vulture/whitelists/pint_whitelist.py b/vulture/whitelists/pint_whitelist.py new file mode 100644 index 00000000..0fb4a395 --- /dev/null +++ b/vulture/whitelists/pint_whitelist.py @@ -0,0 +1,4 @@ +import pint + +ureg = pint.UnitRegistry() +ureg.default_format