From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 51E5745E68; Tue, 10 Dec 2024 11:34:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B39D4065F; Tue, 10 Dec 2024 11:34:26 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id C7DFE4060A for ; Tue, 10 Dec 2024 11:34:21 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 68559113E; Tue, 10 Dec 2024 02:34:49 -0800 (PST) Received: from localhost.localdomain (JR4XG4HTQC.cambridge.arm.com [10.1.31.80]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B1A8F3F58B; Tue, 10 Dec 2024 02:34:20 -0800 (PST) From: Luca Vizzarro To: dev@dpdk.org, Patrick Robb Cc: Luca Vizzarro , Paul Szczepanek Subject: [PATCH 5/6] dts: update dts-check-format to use Ruff Date: Tue, 10 Dec 2024 10:32:52 +0000 Message-ID: <20241210103253.3931003-6-luca.vizzarro@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210103253.3931003-1-luca.vizzarro@arm.com> References: <20241210103253.3931003-1-luca.vizzarro@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace the current linters and formatter in favour of Ruff in the dts-check-format tool. Bugzilla ID: 1358 Bugzilla ID: 1455 Signed-off-by: Luca Vizzarro Reviewed-by: Paul Szczepanek --- devtools/dts-check-format.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/devtools/dts-check-format.sh b/devtools/dts-check-format.sh index 3f43e17e88..44501f6d3b 100755 --- a/devtools/dts-check-format.sh +++ b/devtools/dts-check-format.sh @@ -52,18 +52,11 @@ if $format; then if command -v git > /dev/null; then if git rev-parse --is-inside-work-tree >&-; then heading "Formatting in $directory/" - if command -v black > /dev/null; then - echo "Formatting code with black:" - black . + if command -v ruff > /dev/null; then + echo "Formatting code with ruff:" + ruff format else - echo "black is not installed, not formatting" - errors=$((errors + 1)) - fi - if command -v isort > /dev/null; then - echo "Sorting imports with isort:" - isort . - else - echo "isort is not installed, not sorting imports" + echo "ruff is not installed, not formatting" errors=$((errors + 1)) fi @@ -89,11 +82,18 @@ if $lint; then echo fi heading "Linting in $directory/" - if command -v pylama > /dev/null; then - pylama . - errors=$((errors + $?)) + if command -v ruff > /dev/null; then + ruff check --fix + + git update-index --refresh + retval=$? + if [ $retval -ne 0 ]; then + echo 'The "needs update" files have been fixed by the linter.' + echo 'Please update your commit.' + fi + errors=$((errors + retval)) else - echo "pylama not found, unable to run linter" + echo "ruff not found, unable to run linter" errors=$((errors + 1)) fi fi -- 2.43.0