File tree 2 files changed +3
-10
lines changed
scripts/west_commands/zspdx
2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 1232
1232
" UP015" , # https://docs.astral.sh/ruff/rules/redundant-open-modes
1233
1233
" UP032" , # https://docs.astral.sh/ruff/rules/f-string
1234
1234
]
1235
- "./scripts/west_commands/zspdx/scanner.py" = [
1236
- " SIM113" , # https://docs.astral.sh/ruff/rules/enumerate-for-loop
1237
- " UP008" , # https://docs.astral.sh/ruff/rules/super-call-with-parameters
1238
- " UP015" , # https://docs.astral.sh/ruff/rules/redundant-open-modes
1239
- ]
1240
1235
"./scripts/west_commands/zspdx/walker.py" = [
1241
1236
" E501" , # https://docs.astral.sh/ruff/rules/line-too-long
1242
1237
" F541" , # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
Original file line number Diff line number Diff line change 16
16
# Document scanning should occur.
17
17
class ScannerConfig :
18
18
def __init__ (self ):
19
- super (ScannerConfig , self ).__init__ ()
19
+ super ().__init__ ()
20
20
21
21
# when assembling a Package's data, should we auto-conclude the
22
22
# Package's license, based on the licenses of its Files?
@@ -63,11 +63,9 @@ def getExpressionData(filePath, numLines):
63
63
"""
64
64
log .dbg (f" - getting licenses for { filePath } " )
65
65
66
- with open (filePath , "r" ) as f :
66
+ with open (filePath ) as f :
67
67
try :
68
- lineno = 0
69
- for line in f :
70
- lineno += 1
68
+ for lineno , line in enumerate (f , start = 1 ):
71
69
if lineno > numLines > 0 :
72
70
break
73
71
expression = parseLineForExpression (line )
You can’t perform that action at this time.
0 commit comments