From patchwork Tue Nov 23 07:28:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 48023 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 80A9B3857C76 for ; Tue, 23 Nov 2021 07:28:24 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id C9FDC3858405 for ; Tue, 23 Nov 2021 07:28:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C9FDC3858405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B4149218B2 for ; Tue, 23 Nov 2021 07:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637652487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXsdGNmyPbpPUGMUHV0b0L5qYN2FFrKzTrNM0dq8AwE=; b=unTBwZ3neq/dnd0c7TYA3a3EusGGkGQYBTRZJ/Q799QgMRaWlCuGGQhMatKgF7P4gLfWgh lsO7kz3GdEpHVz5cDYdUZytglm/EXQ0y3uxIZj878/mKj/pyrjrmLAnzdgfGQAZHhXYhM7 o7XZ8/T+K2xdhmJfQANX1tWrRgEI6y0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637652487; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXsdGNmyPbpPUGMUHV0b0L5qYN2FFrKzTrNM0dq8AwE=; b=lhrH2FCIfNaK2mSQxh6oTxililO1hyIcEb2VmMoOv/2NUrCkq5BUnAv41Bb3x15SfpdtYU ng7Y2ARamV2zZlCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A011E134CE for ; Tue, 23 Nov 2021 07:28:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id coCNJQeYnGGFYAAAMHmgww (envelope-from ) for ; Tue, 23 Nov 2021 07:28:07 +0000 Message-ID: <13e56397-2c7b-363b-3934-6b21fe766efc@suse.cz> Date: Tue, 23 Nov 2021 08:28:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH][pushed] contrib: Support itemx in check-params-in-docs.py. To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Pushed to master. Martin contrib/ChangeLog: * check-params-in-docs.py: Support @itemx in param documentation and support multi-line documentation for parameters. --- contrib/check-params-in-docs.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/contrib/check-params-in-docs.py b/contrib/check-params-in-docs.py index 440549f5fd8..d57055088b7 100755 --- a/contrib/check-params-in-docs.py +++ b/contrib/check-params-in-docs.py @@ -47,7 +47,7 @@ ignored = {'logical-op-non-short-circuit'} params = {} for line in open(args.params_output).readlines(): - if line.startswith(' '): + if line.startswith(' ' * 2) and not line.startswith(' ' * 8): r = get_param_tuple(line) params[r[0]] = r[1] @@ -57,15 +57,20 @@ texi = dropwhile(lambda x: 'item --param' not in x, texi) texi = takewhile(lambda x: '@node Instrumentation Options' not in x, texi) texi = list(texi)[1:] -token = '@item ' -texi = [x[len(token):] for x in texi if x.startswith(token)] +texi_params = [] +for line in texi: + for token in ('@item ', '@itemx '): + if line.startswith(token): + texi_params.append(line[len(token):]) + break + # skip digits -texi = [x for x in texi if not x[0].isdigit()] +texi_params = [x for x in texi_params if not x[0].isdigit()] # skip aarch64 params -texi = [x for x in texi if not x.startswith('aarch64')] -sorted_texi = sorted(texi) +texi_params = [x for x in texi_params if not x.startswith('aarch64')] +sorted_params = sorted(texi_params) -texi_set = set(texi) - ignored +texi_set = set(texi_params) - ignored params_set = set(params.keys()) - ignored success = True @@ -84,7 +89,4 @@ if len(missing): print() success = False -if texi != sorted_texi: - print('WARNING: not sorted alphabetically!') - sys.exit(0 if success else 1)