This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 170455e  ARROW-9180: [Developer] Remove usage of whitelist, blacklist, 
slave, etc.
170455e is described below

commit 170455ec0aca6ab7945b5af302beea5e664590dc
Author: Krisztián Szűcs <[email protected]>
AuthorDate: Thu Jun 18 21:13:30 2020 -0500

    ARROW-9180: [Developer] Remove usage of whitelist, blacklist, slave, etc.
    
    I went ahead and changed the obvious ones.
    
    Closes #7484 from kszucs/neutralization
    
    Lead-authored-by: Krisztián Szűcs <[email protected]>
    Co-authored-by: Neal Richardson <[email protected]>
    Signed-off-by: Wes McKinney <[email protected]>
---
 ci/docker/conda-r.dockerfile                       |  2 +-
 ci/docker/linux-apt-r.dockerfile                   |  2 +-
 ci/docker/linux-r.dockerfile                       |  2 +-
 ci/docker/ubuntu-18.04-r-sanitizer.dockerfile      |  2 +-
 cpp/build-support/cpplint.py                       | 26 +++++++++++-----------
 ...cklist.txt => sanitizer-disallowed-entries.txt} |  0
 cpp/cmake_modules/san-config.cmake                 |  8 +++----
 dev/archery/archery/cli.py                         | 14 +++++++-----
 dev/archery/archery/lang/python.py                 |  8 +++----
 dev/archery/archery/utils/lint.py                  |  6 ++---
 r/Makefile                                         |  6 ++---
 11 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/ci/docker/conda-r.dockerfile b/ci/docker/conda-r.dockerfile
index ad8e59f..79b6ebc 100644
--- a/ci/docker/conda-r.dockerfile
+++ b/ci/docker/conda-r.dockerfile
@@ -36,7 +36,7 @@ RUN conda install -q \
     conda clean --all
 
 # Ensure parallel compilation of of C/C++ code
-RUN echo "MAKEFLAGS=-j$(R --slave -e 'cat(parallel::detectCores())')" >> 
$CONDA_PREFIX/lib/R/etc/Makeconf
+RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> 
$CONDA_PREFIX/lib/R/etc/Makeconf
 
 ENV ARROW_BUILD_STATIC=OFF \
     ARROW_BUILD_TESTS=OFF \
diff --git a/ci/docker/linux-apt-r.dockerfile b/ci/docker/linux-apt-r.dockerfile
index 7f81e11..8582735 100644
--- a/ci/docker/linux-apt-r.dockerfile
+++ b/ci/docker/linux-apt-r.dockerfile
@@ -64,7 +64,7 @@ RUN apt-get update -y && \
 COPY ci/etc/rprofile /arrow/ci/etc/
 RUN cat /arrow/ci/etc/rprofile >> $(R RHOME)/etc/Rprofile.site
 # Also ensure parallel compilation of C/C++ code
-RUN echo "MAKEFLAGS=-j$(R --slave -e 'cat(parallel::detectCores())')" >> $(R 
RHOME)/etc/Makeconf
+RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> $(R 
RHOME)/etc/Makeconf
 
 COPY ci/scripts/r_deps.sh /arrow/ci/scripts/
 COPY r/DESCRIPTION /arrow/r/
diff --git a/ci/docker/linux-r.dockerfile b/ci/docker/linux-r.dockerfile
index d23b802..5de562d 100644
--- a/ci/docker/linux-r.dockerfile
+++ b/ci/docker/linux-r.dockerfile
@@ -28,7 +28,7 @@ ENV PATH "${RPREFIX}/bin:${PATH}"
 COPY ci/etc/rprofile /arrow/ci/etc/
 RUN cat /arrow/ci/etc/rprofile >> $(R RHOME)/etc/Rprofile.site
 # Also ensure parallel compilation of C/C++ code
-RUN echo "MAKEFLAGS=-j$(R --slave -e 'cat(parallel::detectCores())')" >> $(R 
RHOME)/etc/Makeconf
+RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> $(R 
RHOME)/etc/Makeconf
 # Workaround for html help install failure; see 
https://github.com/r-lib/devtools/issues/2084#issuecomment-530912786
 RUN Rscript -e 'x <- file.path(R.home("doc"), "html"); if (!file.exists(x)) 
{dir.create(x, recursive=TRUE); file.copy(system.file("html/R.css", 
package="stats"), x)}'
 
diff --git a/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile 
b/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile
index a865f9f..4c96b64 100644
--- a/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile
+++ b/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile
@@ -60,7 +60,7 @@ RUN printf "\
     >> /usr/local/RDsan/lib/R/etc/Rprofile.site
 
 # Also ensure parallel compilation of C/C++ code
-RUN echo "MAKEFLAGS=-j$(R --slave -e 'cat(parallel::detectCores())')" >> 
/usr/local/RDsan/lib/R/etc/Makeconf
+RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> 
/usr/local/RDsan/lib/R/etc/Makeconf
 
 # Prioritize system packages and local installation
 # The following dependencies will be downloaded due to missing/invalid packages
diff --git a/cpp/build-support/cpplint.py b/cpp/build-support/cpplint.py
index 5446640..470623d 100755
--- a/cpp/build-support/cpplint.py
+++ b/cpp/build-support/cpplint.py
@@ -4008,9 +4008,9 @@ def CheckTrailingSemicolon(filename, clean_lines, 
linenum, error):
 
   # Block bodies should not be followed by a semicolon.  Due to C++11
   # brace initialization, there are more places where semicolons are
-  # required than not, so we use a whitelist approach to check these
-  # rather than a blacklist.  These are the places where "};" should
-  # be replaced by just "}":
+  # required than not, so we use explicitly list the allowed rules
+  # rather than listing the disallowed ones.  These are the places
+  # where "};" should be replaced by just "}":
   # 1. Some flavor of block following closing parenthesis:
   #    for (;;) {};
   #    while (...) {};
@@ -4066,11 +4066,11 @@ def CheckTrailingSemicolon(filename, clean_lines, 
linenum, error):
     #  - INTERFACE_DEF
     #  - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
     #
-    # We implement a whitelist of safe macros instead of a blacklist of
+    # We implement a list of safe macros instead of a list of
     # unsafe macros, even though the latter appears less frequently in
     # google code and would have been easier to implement.  This is because
-    # the downside for getting the whitelist wrong means some extra
-    # semicolons, while the downside for getting the blacklist wrong
+    # the downside for getting the allowed checks wrong means some extra
+    # semicolons, while the downside for getting disallowed checks wrong
     # would result in compile errors.
     #
     # In addition to macros, we also don't want to warn on
@@ -5281,19 +5281,19 @@ def CheckForNonConstReference(filename, clean_lines, 
linenum,
   #
   # We also accept & in static_assert, which looks like a function but
   # it's actually a declaration expression.
-  whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
-                           r'operator\s*[<>][<>]|'
-                           r'static_assert|COMPILE_ASSERT'
-                           r')\s*\(')
-  if Search(whitelisted_functions, line):
+  allowed_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
+                       r'operator\s*[<>][<>]|'
+                       r'static_assert|COMPILE_ASSERT'
+                       r')\s*\(')
+  if Search(allowed_functions, line):
     return
   elif not Search(r'\S+\([^)]*$', line):
-    # Don't see a whitelisted function on this line.  Actually we
+    # Don't see an allowed function on this line.  Actually we
     # didn't see any function name on this line, so this is likely a
     # multi-line parameter list.  Try a bit harder to catch this case.
     for i in xrange(2):
       if (linenum > i and
-          Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])):
+          Search(allowed_functions, clean_lines.elided[linenum - i - 1])):
         return
 
   decls = ReplaceAll(r'{[^}]*}', ' ', line)  # exclude function body
diff --git a/cpp/build-support/sanitize-blacklist.txt 
b/cpp/build-support/sanitizer-disallowed-entries.txt
similarity index 100%
rename from cpp/build-support/sanitize-blacklist.txt
rename to cpp/build-support/sanitizer-disallowed-entries.txt
diff --git a/cpp/cmake_modules/san-config.cmake 
b/cpp/cmake_modules/san-config.cmake
index 0780a19..2e28078 100644
--- a/cpp/cmake_modules/san-config.cmake
+++ b/cpp/cmake_modules/san-config.cmake
@@ -113,18 +113,18 @@ if(${ARROW_USE_COVERAGE})
 endif()
 
 if("${ARROW_USE_UBSAN}" OR "${ARROW_USE_ASAN}" OR "${ARROW_USE_TSAN}")
-  # GCC 4.8 and 4.9 (latest as of this writing) don't allow you to specify a
-  # sanitizer blacklist.
+  # GCC 4.8 and 4.9 (latest as of this writing) don't allow you to specify
+  # disallowed entries for the sanitizer.
   if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"
      OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     set(
       CMAKE_CXX_FLAGS
-      "${CMAKE_CXX_FLAGS} 
-fsanitize-blacklist=${BUILD_SUPPORT_DIR}/sanitize-blacklist.txt"
+      "${CMAKE_CXX_FLAGS} 
-fsanitize-blacklist=${BUILD_SUPPORT_DIR}/sanitizer-disallowed-entries.txt"
       )
   else()
     message(
       WARNING
-        "GCC does not support specifying a sanitizer blacklist. Known 
sanitizer check failures will not be suppressed."
+        "GCC does not support specifying a sanitizer disallowed entries list. 
Known sanitizer check failures will not be suppressed."
       )
   endif()
 endif()
diff --git a/dev/archery/archery/cli.py b/dev/archery/archery/cli.py
index 82ab56a..a8a7799 100644
--- a/dev/archery/archery/cli.py
+++ b/dev/archery/archery/cli.py
@@ -318,9 +318,11 @@ def lint(ctx, src, fix, iwyu_all, **checks):
 @click.option("--src", metavar="<arrow_src>", default=None,
               callback=validate_arrow_sources,
               help="Specify Arrow source directory")
[email protected]("--whitelist", "-w", help="Allow only these rules")
[email protected]("--blacklist", "-b", help="Disallow these rules")
-def numpydoc(src, symbols, whitelist, blacklist):
[email protected]("--allow-rule", "-a", multiple=True,
+              help="Allow only these rules")
[email protected]("--disallow-rule", "-d", multiple=True,
+              help="Disallow these rules")
+def numpydoc(src, symbols, allow_rule, disallow_rule):
     """
     Pass list of modules or symbols as arguments to restrict the validation.
 
@@ -332,10 +334,10 @@ def numpydoc(src, symbols, whitelist, blacklist):
     archery numpydoc pyarrow.csv pyarrow.json pyarrow.parquet
     archery numpydoc pyarrow.array
     """
-    blacklist = blacklist or {'GL01', 'SA01', 'EX01', 'ES01'}
+    disallow_rule = disallow_rule or {'GL01', 'SA01', 'EX01', 'ES01'}
     try:
-        results = python_numpydoc(symbols, whitelist=whitelist,
-                                  blacklist=blacklist)
+        results = python_numpydoc(symbols, allow_rules=allow_rule,
+                                  disallow_rule=disallow_rule)
         for result in results:
             result.ok()
     except LintValidationException:
diff --git a/dev/archery/archery/lang/python.py 
b/dev/archery/archery/lang/python.py
index 9b79971..4952d5f 100644
--- a/dev/archery/archery/lang/python.py
+++ b/dev/archery/archery/lang/python.py
@@ -187,8 +187,8 @@ class NumpyDoc:
             Docstring._load_obj = orig_load_obj
             inspect.signature = orig_signature
 
-    def validate(self, from_package='', rules_blacklist=None,
-                 rules_whitelist=None):
+    def validate(self, from_package='', allow_rules=None,
+                 disallow_rules=None):
         results = []
 
         def callback(obj):
@@ -196,9 +196,9 @@ class NumpyDoc:
 
             errors = []
             for errcode, errmsg in result.get('errors', []):
-                if rules_whitelist and errcode not in rules_whitelist:
+                if allow_rules and errcode not in allow_rules:
                     continue
-                if rules_blacklist and errcode in rules_blacklist:
+                if disallow_rules and errcode in disallow_rules:
                     continue
                 errors.append((errcode, errmsg))
 
diff --git a/dev/archery/archery/utils/lint.py 
b/dev/archery/archery/utils/lint.py
index ed31b23..e4bc6e3 100644
--- a/dev/archery/archery/utils/lint.py
+++ b/dev/archery/archery/utils/lint.py
@@ -170,7 +170,7 @@ def python_linter(src, fix=False):
                                      check=False))
 
 
-def python_numpydoc(symbols=None, whitelist=None, blacklist=None):
+def python_numpydoc(symbols=None, allow_rules=None, disallow_rules=None):
     """Run numpydoc linter on python.
 
     Pyarrow must be available for import.
@@ -203,8 +203,8 @@ def python_numpydoc(symbols=None, whitelist=None, 
blacklist=None):
     results = numpydoc.validate(
         # limit the validation scope to the pyarrow package
         from_package='pyarrow',
-        rules_whitelist=whitelist,
-        rules_blacklist=blacklist
+        allow_rules=allow_rules,
+        disallow_rules=disallow_rules
     )
 
     if len(results) == 0:
diff --git a/r/Makefile b/r/Makefile
index ed2e866..a04a388 100644
--- a/r/Makefile
+++ b/r/Makefile
@@ -19,15 +19,15 @@ VERSION=$(shell grep ^Version DESCRIPTION | sed s/Version:\ 
//)
 ARROW_R_DEV="TRUE"
 
 doc:
-       R --slave -e 'roxygen2::roxygenize()'
+       R -s -e 'roxygen2::roxygenize()'
        -git add --all man/*.Rd
 
 test:
        export ARROW_R_DEV=$(ARROW_R_DEV) && R CMD INSTALL --install-tests 
--no-test-load --no-docs --no-help --no-byte-compile .
-       export NOT_CRAN=true && export ARROW_R_DEV=$(ARROW_R_DEV) && export 
AWS_EC2_METADATA_DISABLED=TRUE && R --slave -e 'library(testthat); 
setwd(file.path(.libPaths()[1], "arrow", "tests")); 
system.time(test_check("arrow", filter="${file}", 
reporter=ifelse(nchar("${r}"), "${r}", "summary")))'
+       export NOT_CRAN=true && export ARROW_R_DEV=$(ARROW_R_DEV) && export 
AWS_EC2_METADATA_DISABLED=TRUE && R -s -e 'library(testthat); 
setwd(file.path(.libPaths()[1], "arrow", "tests")); 
system.time(test_check("arrow", filter="${file}", 
reporter=ifelse(nchar("${r}"), "${r}", "summary")))'
 
 deps:
-       R --slave -e 'lib <- Sys.getenv("R_LIB", .libPaths()[1]); 
install.packages("devtools", repo="https://cloud.r-project.org";, lib=lib); 
devtools::install_dev_deps(lib=lib)'
+       R -s -e 'lib <- Sys.getenv("R_LIB", .libPaths()[1]); 
install.packages("devtools", repo="https://cloud.r-project.org";, lib=lib); 
devtools::install_dev_deps(lib=lib)'
 
 build: doc
        cp ../NOTICE.txt inst/NOTICE.txt

Reply via email to