From patchwork Wed Jun 5 05:16:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13686153 Received: from wfout7-smtp.messagingengine.com (wfout7-smtp.messagingengine.com [64.147.123.150]) (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 6816238FB9 for ; Wed, 5 Jun 2024 05:16:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717564618; cv=none; b=dYP+kFtICFqZFo0luTR8w55P0UEuhyv/Bj2o/WdA5F80AYS7DQchoVaaq/loWza4npjFEDxUZbtyWcIvexM5gEbOROJGKeITrLAX/04P+69vV4GxscyGZl+C9EMFWFoWH80SSaVy03PBbJg8OSM+YwhAi/ze3L0eHxayZg5oU84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717564618; c=relaxed/simple; bh=2XotbK05F7RrzfIxF9zLmhFF4NhswpD0cNycJoxJpf8=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F3HPyjgtrAmMHuNIr0+BC0tGi40SHPtfC3XO8CkWJOF5G4p8tsG7xge+mjlgsrHBGti0MzFsIIxGIjDxBR0rLKGg90AqmrQOV0Nrk4pcKwWp3BiQEz5CAD1lDeQIohglBsbPOuJC0xyUMuPzdpkOjGEDQtMmgRwnAcsYnHk1HfA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=NqtZdmG4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=h6PJh/FT; arc=none smtp.client-ip=64.147.123.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="NqtZdmG4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="h6PJh/FT" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id 9FAE31C0016E for ; Wed, 5 Jun 2024 01:16:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 05 Jun 2024 01:16:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1717564615; x=1717651015; bh=p66hhxpA8q L2wnLJTKooBS0mrv/6yiO344wLPKNN36E=; b=NqtZdmG4BGFwI0qnOzWwwYW60e ZAeNtqnUCPvwIpfhLO+DX3+GzH8KU8MfzikWLf5413YjI/VGBt9ossS78kk+aG62 fIyIhWpyf4WrqP7s+OQP46k0/NVL8HmY/LvJtdsE1CQBdsQM58tpAqnF+womJnyy 9wgBDE0JXWJ2g99H07uPUG5sbRZa3y1BLBjtCflPqUAH931xcwzpZlkp956dXrqP LFeCBQE1IUIgYD/WTFBw18s34I0jmHN5ZHiUXze8CTPIa7h5uxC3tZW3LIjQkCCu dLAprCwxnUt6n9E+pEtQzCuYqTnPHaJelssYNrn/Gzfmi0MKtU7FASuVpoxQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717564615; x=1717651015; bh=p66hhxpA8qL2wnLJTKooBS0mrv/6 yiO344wLPKNN36E=; b=h6PJh/FTZ4YaodLCnNEhwvDl9rlaoZrF25F66MkjCh8r NaYLnYLF3FcHfBOkn8REjl+5oj8GqY0PDCbxIaCxlOkQDIPaOJ32cLFE2S/DAmTC b0+MSyuxzGSb0c1gtVuN5rVXSR3OqitnyeBFhVwYaPHMHrOlTHqlK75Czea8rrTe rjaHvguN4NP8rnhxK5xbqDAHNd+KiCR19aQvlqv+fIUFH05NOMI5aSuncKkd4/C9 WBjDVsMFNEMbL5fMTLOMpmKVj2f+ab+agl2c/sJCo/wTV+Tyuaf78XPHf9whLrfX 5hw1Zum0rtWeGfSd5ztMYbHE3ZYTBWUHQKdPrNI19w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelhedgleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesghdtre ertddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehp khhsrdhimheqnecuggftrfgrthhtvghrnhepheeghfdtfeeuffehkefgffduleffjedthf dvjeektdfhhedvlefgtefgvdettdfhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 5 Jun 2024 01:16:54 -0400 (EDT) Received: by localhost (OpenSMTPD) with ESMTPSA id 39b1207d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 5 Jun 2024 05:16:26 +0000 (UTC) Date: Wed, 5 Jun 2024 07:16:51 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 2/4] Documentation/lint-manpages: bubble up errors Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: The "lint-manpages.sh" script does not return an error in case any of its checks fail. While this is faithful to the implementation that we had as part of the "check-docs" target before the preceding commit, it makes it hard to spot any violations of the rules via the corresponding CI job, which will of course exit successfully, too. Adapt the script to bubble up errors. Signed-off-by: Patrick Steinhardt --- Documentation/lint-manpages.sh | 35 +++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/Documentation/lint-manpages.sh b/Documentation/lint-manpages.sh index f720a3f3d6..c7ae8ee17a 100755 --- a/Documentation/lint-manpages.sh +++ b/Documentation/lint-manpages.sh @@ -15,6 +15,8 @@ EOF } check_missing_docs () { + local ret=0 + for v in $BUILT_INS do case "$v" in @@ -34,6 +36,7 @@ check_missing_docs () { if ! test -f "Documentation/$v.txt" then echo "no doc: $v" + ret=1 fi if ! sed -e '1,/^### command list/d' -e '/^#/d' command-list.txt | @@ -43,20 +46,26 @@ check_missing_docs () { git) ;; *) - echo "no link: $v";; + echo "no link: $v" + ret=1 + ;; esac fi done + + return $ret } check_extraneous_docs () { local commands="$(printf "%s\n" "$ALL_COMMANDS" "$BUILT_INS" "$EXCLUDED_PROGRAMS")" + local ret=0 while read how cmd do if ! [[ $commands = *"$cmd"* ]] then echo "removed but $how: $cmd" + ret=1 fi done < <( sed -e '1,/^### command list/d' \ @@ -70,13 +79,29 @@ check_extraneous_docs () { sed -e 's|^|documented |' \ -e 's/\.txt//' ) + + return $ret } BUILT_INS="$(extract_variable BUILT_INS)" ALL_COMMANDS="$(extract_variable ALL_COMMANDS)" EXCLUDED_PROGRAMS="$(extract_variable EXCLUDED_PROGRAMS)" -{ - check_missing_docs - check_extraneous_docs -} | sort +findings=$( + if ! check_missing_docs + then + ret=1 + fi + + if ! check_extraneous_docs + then + ret=1 + fi + + exit $ret +) +ret=$? + +echo "$findings" | sort + +exit $ret