From 2ee5a24417f9231e643df99bdcf927aa8440db57 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Thu, 7 Nov 2024 10:59:30 +0100 Subject: [PATCH] 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 --- scripts/ci/check_compliance.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 63e7fb948b7..5a3f1deda25 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -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,