Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwZxw-00068F-OM for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jan 2021 00:12:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kwZxv-0004xL-Kl for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jan 2021 00:12:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwZxt-0004xD-TA for pgsql-hackers@lists.postgresql.org; Tue, 05 Jan 2021 00:12:47 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwZxr-0006jF-2O for pgsql-hackers@postgresql.org; Tue, 05 Jan 2021 00:12:44 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0CAF75C012F; Mon, 4 Jan 2021 19:12:42 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 04 Jan 2021 19:12:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h= from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=fm1; bh=w6e/bJlziklK3Kh/4m7DWy2jbe UKvpICCAyujbOzXy8=; b=GO3eW3v6yVtO6mCxv3ljspkf5XF/qoMyMV2Ac6vhde gPfE7qTTB5XP+38FBxq/RQm37uHjtcYx8TPm/XJmwZnce97lqFZhtlHF6lNCcMWm GXNXFO8x/LbXeKWT3nvGb6a75i7yurTvmiGKMmSIBy7cIpto6y0UrOwW3rA6GFXV rvfLsz40wXU5EB3BgDzZIpuoQ7IrhfOFoHt7T7mhOyzXtS3eYCNX1fUhHvvbxWdk nVwuZc3N8c147NmIr8AMUW3IQqEQzs+BV7HjidZ99JpyzfnHPhDBlM6cnDo3WF09 afb9kjNl9qmxQetJ4wOt4Wx53PPEapWEW53BY/YWLiWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=w6e/bJ lziklK3Kh/4m7DWy2jbeUKvpICCAyujbOzXy8=; b=RES5197JRnhe3UfAu7zRfP weV690uqlptybojbKjv8vCqxzXTKCY0Eq4Hyh919/kueQOD7+5+AQZA7khDa1t8F o+HxBGhpOS4Vo7sssTd9tzQNKzztKtFAjMwckBqiFF/JndeQBHM7VXBDWXoAgaeu LksO99Y1W2nqcoMOOz+60TWSVO38FOINfbUwFg1sI3GD+XUVrMNGBeSBKmaFNwBf CPI5u9h0ZC1FWnLgAg/GvxNNNamuURs/kfOtqKgwIIk2xmC3leWgM8rFuRoghWMt 9F0ktf/VJtoJlKm5TtuhtyCWXNUauuJCe8NWgdu8RLWv54pleSzyPfQuygh+p4gg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdefgedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtsehmtderredtreejnecuhfhrohhmpehilhhmrghr ihesihhlmhgrrhhirdhorhhgucdlffgrghhfihhnnhcukfhlmhgrrhhiucforghnnhhsno hkvghrmdenucggtffrrghtthgvrhhnpeekkeffueekgfdukedugfelledvgeejtefgledu hfehteeffeevgfeguedtffekhfenucfkphepgeeirdegfedrudehrddvhedvnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhlmhgrrhhisehi lhhmrghrihdrohhrgh X-ME-Proxy: Received: from wibble.ilmari.org (wibble.ilmari.org [46.43.15.252]) by mail.messagingengine.com (Postfix) with ESMTPA id 045AD108005F; Mon, 4 Jan 2021 19:12:40 -0500 (EST) From: ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) To: Magnus Hagander Cc: Andres Freund , PostgreSQL-development Subject: Re: language cleanups in code and docs References: <20200615182235.x7lch5n6kcjq4aue@alap3.anarazel.de> Date: Tue, 05 Jan 2021 00:12:39 +0000 In-Reply-To: (Magnus Hagander's message of "Wed, 17 Jun 2020 12:32:14 +0200") Message-ID: <87wnws6y2w.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=-=-= Content-Type: text/plain Magnus Hagander writes: > In looking at this I realize we also have exactly one thing referred to as > "blacklist" in our codebase, which is the "enum blacklist" (and then a > small internal variable in pgindent). Here's a patch that renames the @whitelist and %blacklist variables in pgindent to @additional and %excluded, and adjusts the comments to match. - ilmari -- "The surreality of the universe tends towards a maximum" -- Skud's Law "Never formulate a law or axiom that you're not prepared to live with the consequences of." -- Skud's Meta-Law --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Rename-whitelist-blacklist-in-pgindent-to-additional.patch From 6525826bdf87ce02bd0a1648f94c7122290907f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Tue, 5 Jan 2021 00:10:07 +0000 Subject: [PATCH] Rename whitelist/blacklist in pgindent to additional/excluded --- src/tools/pgindent/pgindent | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index 4124d27dea..feb02067c5 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -54,12 +54,12 @@ $excludes ||= "$code_base/src/tools/pgindent/exclude_file_patterns" # some names we want to treat like typedefs, e.g. "bool" (which is a macro # according to ), and may include some names we don't want # treated as typedefs, although various headers that some builds include -# might make them so. For the moment we just hardwire a whitelist of names -# to add and a blacklist of names to remove; eventually this may need to be +# might make them so. For the moment we just hardwire a list of names +# to add and a list of names to exclude; eventually this may need to be # easier to configure. Note that the typedefs need trailing newlines. -my @whitelist = ("bool\n"); +my @additional = ("bool\n"); -my %blacklist = map { +"$_\n" => 1 } qw( +my %excluded = map { +"$_\n" => 1 } qw( ANY FD_SET U abs allocfunc boolean date digit ilist interval iterator other pointer printfunc reference string timestamp type wrap ); @@ -134,11 +134,11 @@ sub load_typedefs } } - # add whitelisted entries - push(@typedefs, @whitelist); + # add additional entries + push(@typedefs, @additional); - # remove blacklisted entries - @typedefs = grep { !$blacklist{$_} } @typedefs; + # remove excluded entries + @typedefs = grep { !$excluded{$_} } @typedefs; # write filtered typedefs my $filter_typedefs_fh = new File::Temp(TEMPLATE => "pgtypedefXXXXX"); -- 2.29.2 --=-=-=--