From 756abb2455aa2a0f22b56b808d9eefbc641059ee Mon Sep 17 00:00:00 2001 From: Josselin Date: Mon, 3 May 2021 18:22:48 +0200 Subject: [PATCH] Use pylint 2.8.2 --- CONTRIBUTING.md | 2 +- slither/tools/upgradeability/checks/constant.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e22fdbb2a6..c6cc6d24a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ To run them locally in the root dir of the repository: - `pylint slither tests --rcfile pyproject.toml` - `black . --config pyproject.toml` -We use pylint `2.7.2` black `20.8b1`. +We use pylint `2.8.2` black `20.8b1`. ### Detectors tests For each new detector, at least one regression tests must be present. diff --git a/slither/tools/upgradeability/checks/constant.py b/slither/tools/upgradeability/checks/constant.py index 7bbf5817e3..ca4549a68a 100644 --- a/slither/tools/upgradeability/checks/constant.py +++ b/slither/tools/upgradeability/checks/constant.py @@ -48,8 +48,7 @@ def _check(self): state_variables_v2 = contract_v2.state_variables v2_additional_variables = len(state_variables_v2) - len(state_variables_v1) - if v2_additional_variables < 0: - v2_additional_variables = 0 + v2_additional_variables = max(v2_additional_variables, 0) # We keep two index, because we need to have them out of sync if v2 # has additional non constant variables @@ -130,8 +129,7 @@ def _check(self): state_variables_v2 = contract_v2.state_variables v2_additional_variables = len(state_variables_v2) - len(state_variables_v1) - if v2_additional_variables < 0: - v2_additional_variables = 0 + v2_additional_variables = max(v2_additional_variables, 0) # We keep two index, because we need to have them out of sync if v2 # has additional non constant variables