scripts: ci: check_compliance: Simplify line number in loop
Use the builtin enumerate function rather than a manual variable. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
8703381764
commit
2ee5a24417
1 changed files with 1 additions and 3 deletions
|
@ -346,9 +346,7 @@ class DevicetreeBindingsCheck(ComplianceTest):
|
|||
|
||||
def required_false_check(self, dts_binding):
|
||||
with open(dts_binding) as file:
|
||||
line_number = 0
|
||||
for line in file:
|
||||
line_number += 1
|
||||
for line_number, line in enumerate(file, 1):
|
||||
if 'required: false' in line:
|
||||
self.fmtd_failure(
|
||||
'warning', 'Devicetree Bindings', dts_binding,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue