From dfba03252ab83d5db2180fe5522816b730a5a993 Mon Sep 17 00:00:00 2001 From: Eduard Tudenhoefner Date: Mon, 28 Feb 2022 08:49:26 +0100 Subject: [PATCH] Make flake8-bandit work with latest bandit 1.7.3 version Fixes #21 flake8-bandit 1.7.3 (https://github.com/PyCQA/bandit/pull/496) introduced an `fdata` argument and this just passes a `None` to make things work with the latest version of bandit. --- flake8_bandit.py | 13 +++++++------ setup.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/flake8_bandit.py b/flake8_bandit.py index 117ca2c..daa001c 100644 --- a/flake8_bandit.py +++ b/flake8_bandit.py @@ -107,12 +107,13 @@ def _check_source(self): return [] bnv = BanditNodeVisitor( - self.filename, - BanditMetaAst(), - BanditTestSet(BanditConfig(), profile=config.profile), - False, - [], - Metrics(), + fname=self.filename, + fdata=None, + metaast=BanditMetaAst(), + testset=BanditTestSet(BanditConfig(), profile=config.profile), + debug=False, + nosec_lines=[], + metrics=Metrics(), ) bnv.generic_visit(self.tree) return [ diff --git a/setup.py b/setup.py index 3aa0781..fe08680 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def get_version(fname="flake8_bandit.py"): VERSION = get_version() # What packages are required for this module to be executed? -REQUIRED = ["flake8", "bandit", "flake8-polyfill", "pycodestyle"] +REQUIRED = ["flake8", "bandit>=1.7.3", "flake8-polyfill", "pycodestyle"] # What packages are optional? EXTRAS = {