Skip to content

Commit

Permalink
Fix reading the number argument from config file (#923)
Browse files Browse the repository at this point in the history
* Fix reading the number argument from config file

When passing the "number" option from the INI file we did
not take into account to store its value as an integer
(when that value is not None).

Resolves: #922

* Implement a cleaner fix

We use the "or" boolean operation to have a
cleaner implementation of the solution.
  • Loading branch information
KAUTH committed Jul 7, 2022
1 parent 9832461 commit 39cdfab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bandit/cli/main.py
Expand Up @@ -512,7 +512,7 @@ def main():
args.context_lines = _log_option_source(
parser.get_default("context_lines"),
args.context_lines,
ini_options.get("number"),
int(ini_options.get("number") or 0) or None,
"max code lines output for issue",
)

Expand Down

0 comments on commit 39cdfab

Please sign in to comment.