root: run bandit as part of pre-commit
This commit is contained in:
		| @ -1,6 +1,5 @@ | |||||||
| """passbook saml source processor""" | """passbook saml source processor""" | ||||||
| from typing import Optional | from typing import TYPE_CHECKING, Optional | ||||||
| from xml.etree.ElementTree import Element |  | ||||||
|  |  | ||||||
| from defusedxml import ElementTree | from defusedxml import ElementTree | ||||||
| from django.http import HttpRequest | from django.http import HttpRequest | ||||||
| @ -16,6 +15,8 @@ from passbook.sources.saml.exceptions import ( | |||||||
| from passbook.sources.saml.models import SAMLSource | from passbook.sources.saml.models import SAMLSource | ||||||
|  |  | ||||||
| LOGGER = get_logger() | LOGGER = get_logger() | ||||||
|  | if TYPE_CHECKING: | ||||||
|  |     from xml.etree.ElementTree import Element  # nosec | ||||||
|  |  | ||||||
|  |  | ||||||
| class Processor: | class Processor: | ||||||
| @ -23,7 +24,7 @@ class Processor: | |||||||
|  |  | ||||||
|     _source: SAMLSource |     _source: SAMLSource | ||||||
|  |  | ||||||
|     _root: Element |     _root: "Element" | ||||||
|     _root_xml: str |     _root_xml: str | ||||||
|  |  | ||||||
|     def __init__(self, source: SAMLSource): |     def __init__(self, source: SAMLSource): | ||||||
|  | |||||||
| @ -2,5 +2,6 @@ | |||||||
| isort -rc passbook | isort -rc passbook | ||||||
| black passbook | black passbook | ||||||
| scripts/coverage.sh | scripts/coverage.sh | ||||||
|  | bandit -r passbook | ||||||
| pylint passbook | pylint passbook | ||||||
| prospector | prospector | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer