Skip to content

Commit 2ee5a24

Browse files
pdgendtnashif
authored andcommitted
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 <[email protected]>
1 parent 8703381 commit 2ee5a24

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scripts/ci/check_compliance.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,7 @@ def parse_dt_bindings(self):
346346

347347
def required_false_check(self, dts_binding):
348348
with open(dts_binding) as file:
349-
line_number = 0
350-
for line in file:
351-
line_number += 1
349+
for line_number, line in enumerate(file, 1):
352350
if 'required: false' in line:
353351
self.fmtd_failure(
354352
'warning', 'Devicetree Bindings', dts_binding,

0 commit comments

Comments
 (0)