pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ilmari@ilmari.org
To: Magnus Hagander <magnus@hagander.net>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: language cleanups in code and docs
Date: Tue, 05 Jan 2021 00:12:39 +0000
Message-ID: <87wnws6y2w.fsf@wibble.ilmari.org> (raw)
In-Reply-To: <CABUevEy0vPwsuQ8K_=xLW6=4hFoVCvdxtDpr14FXW55i=8CZYw@mail.gmail.com>
References: <20200615182235.x7lch5n6kcjq4aue@alap3.anarazel.de>
	<CABUevEy0vPwsuQ8K_=xLW6=4hFoVCvdxtDpr14FXW55i=8CZYw@mail.gmail.com>

Magnus Hagander <magnus@hagander.net> 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

Attachments:

0001-Rename-whitelist-blacklist-in-pgindent-to-additional.patch (text/x-diff, 1.9K) download From 6525826bdf87ce02bd0a1648f94c7122290907f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org> 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 <stdbool.h>), 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

view thread (47+ messages)  latest in thread

Message-ID: <87wnws6y2w.fsf@wibble.ilmari.org>
Permalink:  ../87wnws6y2w.fsf@wibble.ilmari.org/
Also on:    postgresql.org/message-id/87wnws6y2w.fsf@wibble.ilmari.org

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ilmari@ilmari.org, magnus@hagander.net, andres@anarazel.de
  Subject: Re: language cleanups in code and docs
  In-Reply-To: <87wnws6y2w.fsf@wibble.ilmari.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox