You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by jo...@apache.org on 2021/04/18 17:35:40 UTC

[arrow-rs] branch ci-fix updated: Fixed Linting.

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

jorgecarleitao pushed a commit to branch ci-fix
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/ci-fix by this push:
     new 445fe62  Fixed Linting.
445fe62 is described below

commit 445fe6262ab6ac304a68fdad06c7371f3c13c557
Author: Jorge C. Leitao <jo...@gmail.com>
AuthorDate: Sun Apr 18 17:35:17 2021 +0000

    Fixed Linting.
---
 .gitignore                          |   3 +
 arrow/src/util/test_util.rs         |   5 +-
 dev/.gitignore                      |   2 +
 dev/archery/archery/cli.py          |   4 ++
 dev/archery/archery/utils/lint.py   |   4 --
 dev/archery/archery/utils/source.py |   8 +--
 dev/release/rat_exclude_files.txt   | 113 ++----------------------------------
 7 files changed, 17 insertions(+), 122 deletions(-)

diff --git a/.gitignore b/.gitignore
index 389f4ab..5b3bf6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,6 @@ target
 rusty-tags.vi
 .history
 .flatbuffers/
+
+.vscode
+venv/*
diff --git a/arrow/src/util/test_util.rs b/arrow/src/util/test_util.rs
index cfbec03..261b245 100644
--- a/arrow/src/util/test_util.rs
+++ b/arrow/src/util/test_util.rs
@@ -98,10 +98,7 @@ pub fn arrow_test_data() -> String {
 /// assert!(std::path::PathBuf::from(filename).exists());
 /// ```
 pub fn parquet_test_data() -> String {
-    match get_data_dir(
-        "PARQUET_TEST_DATA",
-        "../parquet-testing/data",
-    ) {
+    match get_data_dir("PARQUET_TEST_DATA", "../parquet-testing/data") {
         Ok(pb) => pb.display().to_string(),
         Err(err) => panic!("failed to get parquet data dir: {}", err),
     }
diff --git a/dev/.gitignore b/dev/.gitignore
index b079293..c03a7c7 100644
--- a/dev/.gitignore
+++ b/dev/.gitignore
@@ -18,3 +18,5 @@
 # Python virtual environments for dev tools
 .venv*/
 
+__pycache__
+*.egg-info
diff --git a/dev/archery/archery/cli.py b/dev/archery/archery/cli.py
index 1dfdaaf..4bbde75 100644
--- a/dev/archery/archery/cli.py
+++ b/dev/archery/archery/cli.py
@@ -289,6 +289,8 @@ def decorate_lint_command(cmd):
 
 
 @archery.command(short_help="Check Arrow source tree for errors")
+@click.option("--src", metavar="<arrow_src>", default=".",
+              help="Specify Arrow source directory")
 @click.option("--fix", is_flag=True, type=BOOL, default=False,
               help="Toggle fixing the lint errors if the linter supports it.")
 @click.option("--iwyu_all", is_flag=True, type=BOOL, default=False,
@@ -298,6 +300,8 @@ def decorate_lint_command(cmd):
 @decorate_lint_command
 @click.pass_context
 def lint(ctx, src, fix, iwyu_all, **checks):
+    src = ArrowSources(src)
+
     if checks.pop('all'):
         # "--all" is given => enable all non-selected checks
         for k, v in checks.items():
diff --git a/dev/archery/archery/utils/lint.py b/dev/archery/archery/utils/lint.py
index 3b94d01..e81d6ac 100644
--- a/dev/archery/archery/utils/lint.py
+++ b/dev/archery/archery/utils/lint.py
@@ -265,10 +265,6 @@ def rat_linter(src, root):
     """Run apache-rat license linter."""
     logger.info("Running apache-rat linter")
 
-    if src.git_dirty:
-        logger.warn("Due to the usage of git-archive, uncommitted files will"
-                    " not be checked for rat violations. ")
-
     exclusion = exclusion_from_globs(
         os.path.join(src.dev, "release", "rat_exclude_files.txt"))
 
diff --git a/dev/archery/archery/utils/source.py b/dev/archery/archery/utils/source.py
index d30b4f1..1ae0fe0 100644
--- a/dev/archery/archery/utils/source.py
+++ b/dev/archery/archery/utils/source.py
@@ -45,13 +45,7 @@ class ArrowSources:
         ----------
         path : src
         """
-        path = Path(path)
-        # validate by checking a specific path in the arrow source tree
-        if not (path / 'cpp' / 'CMakeLists.txt').exists():
-            raise InvalidArrowSource(
-                "No Arrow C++ sources found in {}.".format(path)
-            )
-        self.path = path
+        self.path = Path(path)
 
     @property
     def archery(self):
diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt
index 68f5668..58f937f 100644
--- a/dev/release/rat_exclude_files.txt
+++ b/dev/release/rat_exclude_files.txt
@@ -12,37 +12,6 @@ ci/etc/rprofile
 ci/etc/*.patch
 ci/vcpkg/*.patch
 CHANGELOG.md
-cpp/CHANGELOG_PARQUET.md
-cpp/src/arrow/io/mman.h
-cpp/src/arrow/util/random.h
-cpp/src/arrow/status.cc
-cpp/src/arrow/status.h
-cpp/src/arrow/vendored/*
-cpp/build-support/asan_symbolize.py
-cpp/build-support/cpplint.py
-cpp/build-support/lint_exclusions.txt
-cpp/build-support/iwyu/*
-cpp/cmake_modules/FindPythonLibsNew.cmake
-cpp/cmake_modules/SnappyCMakeLists.txt
-cpp/cmake_modules/SnappyConfig.h
-cpp/examples/parquet/parquet-arrow/cmake_modules/FindArrow.cmake
-cpp/src/parquet/.parquetcppversion
-cpp/src/generated/parquet_constants.cpp
-cpp/src/generated/parquet_constants.h
-cpp/src/generated/parquet_types.cpp
-cpp/src/generated/parquet_types.h
-cpp/src/plasma/thirdparty/ae/ae.c
-cpp/src/plasma/thirdparty/ae/ae.h
-cpp/src/plasma/thirdparty/ae/ae_epoll.c
-cpp/src/plasma/thirdparty/ae/ae_evport.c
-cpp/src/plasma/thirdparty/ae/ae_kqueue.c
-cpp/src/plasma/thirdparty/ae/ae_select.c
-cpp/src/plasma/thirdparty/ae/config.h
-cpp/src/plasma/thirdparty/ae/zmalloc.h
-cpp/src/plasma/thirdparty/dlmalloc.c
-cpp/thirdparty/flatbuffers/include/flatbuffers/base.h
-cpp/thirdparty/flatbuffers/include/flatbuffers/flatbuffers.h
-cpp/thirdparty/flatbuffers/include/flatbuffers/stl_emulation.h
 dev/requirements*.txt
 dev/archery/MANIFEST.in
 dev/archery/requirements*.txt
@@ -115,56 +84,11 @@ dev/tasks/linux-packages/apache-arrow/debian/source/format
 dev/tasks/linux-packages/apache-arrow/debian/watch
 dev/tasks/requirements*.txt
 dev/tasks/conda-recipes/*
-docs/requirements.txt
-go/arrow/flight/Flight_grpc.pb.go
-go/arrow/go.sum
-go/arrow/Gopkg.lock
-go/arrow/flight/Flight.pb.go
-go/arrow/flight/Flight_grpc.pb.go
-go/arrow/internal/cpu/*
-go/arrow/type_string.go
-go/*.tmpldata
-go/*.s
-go/parquet/go.sum
-go/parquet/internal/gen-go/parquet/GoUnusedProtection__.go
-go/parquet/internal/gen-go/parquet/parquet-consts.go
-go/parquet/internal/gen-go/parquet/parquet.go
-js/.npmignore
-js/closure-compiler-scripts/*
-js/src/fb/*.ts
-js/yarn.lock
-js/.eslintignore
-python/cmake_modules
-python/cmake_modules/FindPythonLibsNew.cmake
-python/cmake_modules/SnappyCMakeLists.txt
-python/cmake_modules/SnappyConfig.h
-python/MANIFEST.in
-python/manylinux1/.dockerignore
-python/pyarrow/includes/__init__.pxd
-python/pyarrow/tests/__init__.py
-python/pyarrow/vendored/*
-python/requirements*.txt
 pax_global_header
 MANIFEST.in
 __init__.pxd
 __init__.py
 requirements.txt
-csharp/.gitattributes
-csharp/dummy.git/*
-csharp/src/Apache.Arrow/Flatbuf/*
-csharp/Apache.Arrow.sln
-csharp/examples/FluentBuilderExample/FluentBuilderExample.csproj
-csharp/examples/Examples.sln
-csharp/src/Apache.Arrow/Apache.Arrow.csproj
-csharp/src/Apache.Arrow/Properties/Resources.Designer.cs
-csharp/src/Apache.Arrow/Properties/Resources.resx
-csharp/test/Apache.Arrow.Benchmarks/Apache.Arrow.Benchmarks.csproj
-csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj
-csharp/test/Apache.Arrow.Tests/app.config
-csharp/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj
-csharp/test/Apache.Arrow.Flight.Tests/Apache.Arrow.Flight.Tests.csproj
-csharp/test/Apache.Arrow.Flight.TestWeb/Apache.Arrow.Flight.TestWeb.csproj
-csharp/src/Apache.Arrow.Flight.AspNetCore/Apache.Arrow.Flight.AspNetCore.csproj
 *.html
 *.sgml
 *.css
@@ -173,35 +97,10 @@ csharp/src/Apache.Arrow.Flight.AspNetCore/Apache.Arrow.Flight.AspNetCore.csproj
 *.svg
 *.devhelp2
 *.scss
-r/R/arrowExports.R
-r/src/arrowExports.cpp
-r/DESCRIPTION
-r/LICENSE.md
-r/NAMESPACE
-r/.Rbuildignore
-r/arrow.Rproj
-r/README.md
-r/README.Rmd
-r/man/*.Rd
-r/cran-comments.md
-r/vignettes/*.Rmd
-r/tests/testthat/test-*.txt
-r/inst/include/cpp11.hpp
-r/inst/include/cpp11/*.hpp
 .gitattributes
-ruby/red-arrow/.yardopts
-rust/arrow/test/data/*.csv
-rust/rust-toolchain
-rust/arrow-flight/src/arrow.flight.protocol.rs
-julia/Arrow/Project.toml
-julia/Arrow/README.md
-julia/Arrow/docs/Manifest.toml
-julia/Arrow/docs/Project.toml
-julia/Arrow/docs/make.jl
-julia/Arrow/docs/mkdocs.yml
-julia/Arrow/docs/src/index.md
-julia/Arrow/docs/src/manual.md
-julia/Arrow/docs/src/reference.md
-rust/ballista/rust/benchmarks/tpch/queries/q*.sql
-rust/ballista/rust/scheduler/testdata/*
-rust/ballista/ui/scheduler/yarn.lock
+arrow/test/data/*.csv
+rust-toolchain
+arrow-flight/src/arrow.flight.protocol.rs
+ballista/rust/benchmarks/tpch/queries/q*.sql
+ballista/rust/scheduler/testdata/*
+ballista/ui/scheduler/yarn.lock