You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ko...@apache.org on 2019/12/19 11:16:49 UTC

[avro] branch master updated: AVRO-2623: Enable all available linters when running tests for the whole codebase (#705)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3d54a9e  AVRO-2623: Enable all available linters when running tests for the whole codebase (#705)
3d54a9e is described below

commit 3d54a9e4385358082ba5111f4a546a660f9d6c21
Author: Kengo Seki <se...@apache.org>
AuthorDate: Thu Dec 19 20:16:41 2019 +0900

    AVRO-2623: Enable all available linters when running tests for the whole codebase (#705)
    
    * AVRO-2623: Enable all available linters when running tests for the whole codebase
    
    * Fix the JS interop test to use a proper event listener
---
 build.sh                          | 6 +++---
 lang/js/build.sh                  | 1 +
 lang/js/test/interop_data_test.js | 2 +-
 lang/perl/xt/schema.t             | 2 +-
 lang/ruby/lib/avro/schema.rb      | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/build.sh b/build.sh
index d95a817..cbbdcd5 100755
--- a/build.sh
+++ b/build.sh
@@ -90,10 +90,10 @@ do
       (cd lang/c; ./build.sh test)
       (cd lang/c++; ./build.sh test)
       (cd lang/csharp; ./build.sh test)
-      (cd lang/js; ./build.sh test)
-      (cd lang/ruby; ./build.sh test)
+      (cd lang/js; ./build.sh lint test)
+      (cd lang/ruby; ./build.sh lint test)
       (cd lang/php; ./build.sh test)
-      (cd lang/perl; ./build.sh test)
+      (cd lang/perl; ./build.sh lint test)
 
       (cd lang/py; ./build.sh interop-data-generate)
       (cd lang/py3; python3 setup.py generate_interop_data \
diff --git a/lang/js/build.sh b/lang/js/build.sh
index 69837a4..cc9b69c 100755
--- a/lang/js/build.sh
+++ b/lang/js/build.sh
@@ -23,6 +23,7 @@ for target in "$@"
 do
   case "$target" in
     lint)
+      npm install
       npm run lint
       ;;
     test)
diff --git a/lang/js/test/interop_data_test.js b/lang/js/test/interop_data_test.js
index 2cd9cf8..07468d8 100644
--- a/lang/js/test/interop_data_test.js
+++ b/lang/js/test/interop_data_test.js
@@ -48,7 +48,7 @@ suite('interop', function() {
           .on("data", function () {
             n++;
           })
-          .on("finish", function () {
+          .on("end", function () {
             assert(n > 0);
           });
       }
diff --git a/lang/perl/xt/schema.t b/lang/perl/xt/schema.t
index 69c66ed..5225ce4 100644
--- a/lang/perl/xt/schema.t
+++ b/lang/perl/xt/schema.t
@@ -24,7 +24,7 @@ use_ok 'Avro::Schema';
 
 sub parse {
     next unless /\.avsc$/;
-    open(my $fh, $_);
+    open(my $fh, '<', $_);
     local $/ = undef;
     my $schema = <$fh>;
     close $fh;
diff --git a/lang/ruby/lib/avro/schema.rb b/lang/ruby/lib/avro/schema.rb
index d57ea71..5f1a2d7 100644
--- a/lang/ruby/lib/avro/schema.rb
+++ b/lang/ruby/lib/avro/schema.rb
@@ -140,7 +140,7 @@ module Avro
       @@fp_table = Array.new(256)
       256.times do |i|
         fp = i
-        8.times do |j|
+        8.times do
           fp = (fp >> 1) ^ ( CRC_EMPTY & -( fp & 1 ) )
         end
         @@fp_table[i] = fp