Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 280892D0C82 for ; Tue, 26 Aug 2025 20:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756241808; cv=none; b=hmCdN6V98loxynPKBR+Lb7A7m+6fRzW5GeWoDaHcJQJg3HJ8FDa8Ud2hU/+OVbmkWYmWmE+3iI3cNLH5mjqauUnbwoOUacE6WMKIXJWq9EEcDOk71rtGpI+gBtlV7sqCRbxs2JVxtLy4LKH9HlUP8e1/g8zpgRkCsEhcb0amuPI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756241808; c=relaxed/simple; bh=n/FIJBFtkJxaRyJiLSzfHOstOrPViVmyv7FxrgB9YU0=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=taGO1g7DBTaEMhQ1tX1QIDD36pKYbDRjBCr9qGTuleqRWWxGw0XZoQ1Via5GyLYtsFz3mwe7NieFa1PQKoBHWJNRdAMjP0zfivewiVPYP1ZdQMtnIT14rM9afi/eAuEdgg5VDSjbaDwaQIHOfipcSw3U89i2oRyGJIESBVlf/ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=psah5poH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="psah5poH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFEDDC4CEF4; Tue, 26 Aug 2025 20:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756241807; bh=n/FIJBFtkJxaRyJiLSzfHOstOrPViVmyv7FxrgB9YU0=; h=Date:Reply-To:Subject:To:References:From:In-Reply-To:From; b=psah5poHHthJb1TLOO8nAO2Zi9P6/Xl1F8rxxQ0E9lxCZ+EF8sSA6sDjMhSMdfJyP lKMlGzDSdoBlrzU4Xx5Hx5OhnMEJCg/5f/aVoLTw1E7GL7MyCL7M95/dD6t3yvv+rA 29Ri+Xj0fwTek7RXWkcU42DEz/DgS1DF+c90FkZbSubZ0G39Tc3XwN5XBHc30IBHK2 z+bfjeP2wadwztWt1IRdEX86Uw6FLAwENUSH1Dt8tyiyGNsoLM3bGkqkVUMWjc8Fjs b17bGd8Liy5BE/vbc4LKk2SyN9Z5IJa9kBT5Ysys9axHvID23M6RJbud/JayM0xpyK RKNDo2n2DG5Jw== Message-ID: <3bb53912-6b64-481b-9c8c-0f30c4479477@kernel.org> Date: Tue, 26 Aug 2025 22:56:44 +0200 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: Daniel Gomez Subject: Re: [RFT] scripts: add fix_ansible_lint.py To: Luis Chamberlain , Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev References: <20250823012911.898920-1-mcgrof@kernel.org> Content-Language: en-US From: Daniel Gomez Organization: kernel.org In-Reply-To: <20250823012911.898920-1-mcgrof@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 23/08/2025 03.29, Luis Chamberlain wrote: > Add a script which fixes all fatal ansible-lint errors. > > Usage examples: > python3 scripts/fix_ansible_lint.py --changes-only > > python3 scripts/fix_ansible_lint.py > > python3 scripts/fix_ansible_lint.py playbooks/foo.yml playbooks/bar*.yml > > python3 scripts/fix_ansible_lint.py --dry-run > > python3 scripts/fix_ansible_lint.py --changes-only --check > > This tool goes beyond ansible-lint --fix by handling more issue types > and providing better control over what gets fixed. > > Generated-by: Claude AI > Signed-off-by: Luis Chamberlain This is great! I think we just need to be able to apply recursively and one rule at a time. And it would be great to have these 2 combined: https://github.com/dkruces/kdevops/blob/ansible-lint-wrapper/scripts/ansible-lint-fix-rules.py The ansible-lint-fix-rules is just an ansible-lint --fix= wrapper. It creates a commit based on a template with the appropriate Generated by: tag and rule applied. I adapt the template last minute before pushing the linter fixes as it was too verbose. Adapting that would be great too. I think we can add these features to the fix_ansible_lint.py script. BTW, I really like the option to apply it only to the last commit's lines. I tried implementing it myself but had some trouble. Thanks! ... Here's the combination of both scripts, and the missing linter fixes: https://github.com/linux-kdevops/kdevops/tree/dagomez/more-ansible-lint-fixes I did not manage to split the manual rules in smaller sub-groups/rules. That's the last piece missing, I think. I've sent this branch to the CI for testing. Here the entire claude development branch: https://github.com/dkruces/kdevops/commits/ansible-lint-comprehensive-fixer/