6
6
7
7
from west import log
8
8
9
- from zspdx .walker import WalkerConfig , Walker
10
9
from zspdx .scanner import ScannerConfig , scanDocument
10
+ from zspdx .walker import Walker , WalkerConfig
11
11
from zspdx .writer import writeSPDX
12
12
13
13
14
14
# SBOMConfig contains settings that will be passed along to the various
15
15
# SBOM maker subcomponents.
16
16
class SBOMConfig :
17
17
def __init__ (self ):
18
- super (SBOMConfig , self ).__init__ ()
18
+ super ().__init__ ()
19
19
20
20
# prefix for Document namespaces; should not end with "/"
21
21
self .namespacePrefix = ""
@@ -58,8 +58,8 @@ def setupCmakeQuery(build_dir):
58
58
return True
59
59
else :
60
60
# file doesn't exist, let's create an empty file
61
- cm_fd = open (queryFilePath , "w" )
62
- cm_fd . close ()
61
+ with open (queryFilePath , "w" ):
62
+ pass
63
63
return True
64
64
65
65
@@ -69,8 +69,8 @@ def setupCmakeQuery(build_dir):
69
69
def makeSPDX (cfg ):
70
70
# report any odd configuration settings
71
71
if cfg .analyzeIncludes and not cfg .includeSDK :
72
- log .wrn (f "config: requested to analyze includes but not to generate SDK SPDX document;" )
73
- log .wrn (f "config: will proceed but will discard detected includes for SDK header files" )
72
+ log .wrn ("config: requested to analyze includes but not to generate SDK SPDX document;" )
73
+ log .wrn ("config: will proceed but will discard detected includes for SDK header files" )
74
74
75
75
# set up walker configuration
76
76
walkerCfg = WalkerConfig ()
0 commit comments