yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [yetus] branch master updated: YETUS-782. Remove ruby-lint support
Date Thu, 07 Feb 2019 15:46:01 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 2ea29b5  YETUS-782. Remove ruby-lint support
2ea29b5 is described below

commit 2ea29b5e7617041253e4b81b18ee7818ff7bea2b
Author: Allen Wittenauer <aw@apache.org>
AuthorDate: Sun Feb 3 21:46:39 2019 -0800

    YETUS-782. Remove ruby-lint support
    
    Signed-off-by: Allen Wittenauer <aw@apache.org>
---
 .circleci/config.yml                               |   2 +-
 .gitlab-ci.yml                                     |   2 +-
 .travis.yml                                        |   2 +-
 Jenkinsfile                                        |   2 +-
 .../documentation/in-progress/precommit-basic.md   |   1 -
 .../src/main/shell/test-patch-docker/Dockerfile    |   3 +-
 precommit/src/main/shell/test-patch.d/ruby-lint.sh | 213 ---------------------
 7 files changed, 5 insertions(+), 220 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index a14ce0c..758ccf8 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -43,7 +43,7 @@ jobs:
              ~/repo/precommit/src/main/shell/test-patch.sh
              --plugins=all
              --patch-dir=/tmp/yetus-out
-             --tests-filter=checkstyle,javadoc,rubocop,ruby-lint,test4tests
+             --tests-filter=checkstyle,javadoc,rubocop,test4tests
 
       - save_cache:
           paths:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 52e6228..486ab52 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,7 +24,7 @@ buretoolbox-job:
       --patch-dir=/tmp/yetus-out
       --plugins=all
       --java-home=/usr/lib/jvm/java-8-openjdk-amd64
-      --tests-filter=checkstyle,javadoc,rubocop,ruby-lint,test4tests
+      --tests-filter=checkstyle,javadoc,rubocop,test4tests
 
   artifacts:
     expire_in: 1 week
diff --git a/.travis.yml b/.travis.yml
index 9e10bde..9c96af3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,4 +31,4 @@ script:
     --docker
     --patch-dir=/tmp/yetus-out
     --plugins=all
-    --tests-filter=checkstyle,javadoc,rubocop,ruby-lint,test4tests
+    --tests-filter=checkstyle,javadoc,rubocop,test4tests
diff --git a/Jenkinsfile b/Jenkinsfile
index ff9a624..f568cd3 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -159,7 +159,7 @@ pipeline {
 
                 # don't let these tests cause -1s because we aren't really paying that
                 # much attention to them
-                YETUS_ARGS+=("--tests-filter=checkstyle,javadoc,rubocop,ruby-lint,test4tests")
+                YETUS_ARGS+=("--tests-filter=checkstyle,javadoc,rubocop,test4tests")
 
                 if [[ "${USE_DEBUG_FLAG}" == true ]]; then
                   YETUS_ARGS+=("--debug")
diff --git a/asf-site-src/source/documentation/in-progress/precommit-basic.md b/asf-site-src/source/documentation/in-progress/precommit-basic.md
index 0085bc9..bf882ea 100644
--- a/asf-site-src/source/documentation/in-progress/precommit-basic.md
+++ b/asf-site-src/source/documentation/in-progress/precommit-basic.md
@@ -107,7 +107,6 @@ Language Support, Licensing, and more:
 * [Perl::Critic](http://perlcritic.com/) installed
 * [pylint](http://www.pylint.org/) installed
 * [rubocop](http://batsov.com/rubocop/) installed
-* [ruby-lint](https://github.com/YorickPeterse/ruby-lint) installed
 * [shellcheck](https://github.com/koalaman/shellcheck) installed, preferably 0.3.6 or higher
 * [yamllint](https://github.com/adrienverge/yamllint) installed
 
diff --git a/precommit/src/main/shell/test-patch-docker/Dockerfile b/precommit/src/main/shell/test-patch-docker/Dockerfile
index 4cf4ce0..106bb2b 100644
--- a/precommit/src/main/shell/test-patch-docker/Dockerfile
+++ b/precommit/src/main/shell/test-patch-docker/Dockerfile
@@ -179,7 +179,7 @@ RUN mv /usr/local/bin/pylint /usr/local/bin/pylint2
 RUN ln -s /usr/local/bin/pylint2 /usr/local/bin/pylint
 
 ####
-# Install ruby, rubocop, and ruby-lint
+# Install ruby and associated bits
 ###
 RUN echo 'gem: --no-rdoc --no-ri' >> /root/.gemrc
 RUN apt-get -q update && apt-get -q install --no-install-recommends -y \
@@ -189,7 +189,6 @@ RUN apt-get -q update && apt-get -q install --no-install-recommends
-y \
     && rm -rf /var/lib/apt/lists/*
 RUN gem install rake
 RUN gem install rubocop
-RUN gem install ruby-lint
 RUN gem install bundler -v 1.17.3
 # set some reasonable defaults for ruby
 # user's can always override these as needed
diff --git a/precommit/src/main/shell/test-patch.d/ruby-lint.sh b/precommit/src/main/shell/test-patch.d/ruby-lint.sh
deleted file mode 100755
index a04dc76..0000000
--- a/precommit/src/main/shell/test-patch.d/ruby-lint.sh
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# SHELLDOC-IGNORE
-
-add_test_type ruby_lint
-
-RUBY_LINT_TIMER=0
-
-RUBY_LINT=${RUBY_LINT:-$(command -v ruby-lint 2>/dev/null)}
-
-function ruby_lint_usage
-{
-  yetus_add_option "--ruby-lint=<path>" "path to ruby-lint executable"
-  yetus_add_option "--ruby-lint-config=<path>" "path to ruby-lint config, relative
to source tree [default: none]"
-
-}
-
-function ruby_lint_parse_args
-{
-  local i
-
-  for i in "$@"; do
-    case ${i} in
-    --ruby-lint=*)
-      RUBY_LINT=${i#*=}
-    ;;
-    --ruby-lint-config=*)
-      RUBY_LINT_CONFIG=${i#*=}
-    ;;
-    esac
-  done
-}
-
-function ruby_lint_filefilter
-{
-  local filename=$1
-
-  if [[ ${filename} =~ \.rb$ ]]; then
-    add_test ruby_lint
-  fi
-}
-
-function ruby_lint_precheck
-{
-  if ! verify_command "Ruby-lint" "${RUBY_LINT}"; then
-    add_vote_table 0 ruby-lint "Ruby-lint was not available."
-    delete_test ruby_lint
-  fi
-}
-
-function ruby_lint_exec
-{
-  declare i
-  declare repostatus=$1
-  declare args
-
-  args=('-p' 'syntastic')
-
-  echo "Running ruby-lint against identified ruby scripts."
-  pushd "${BASEDIR}" >/dev/null || return 1
-  if [[ -f "${RUBY_LINT_CONFIG}" ]]; then
-    args+=('-c' "${RUBY_LINT_CONFIG}")
-  fi
-
-  for i in "${CHANGED_FILES[@]}"; do
-    if [[ ${i} =~ \.rb$ && -f ${i} ]]; then
-      "${RUBY_LINT}" -p "${args[@]}" "${i}" | sort -t : -k 1,1 -k 3,3n -k 4,4n >> "${PATCH_DIR}/branch-ruby-lint-result.txt"
-    fi
-  done
-  popd >/dev/null || return 1
-  return 0
-}
-
-function ruby_lint_preapply
-{
-  local i
-
-  if ! verify_needed_test ruby_lint; then
-    return 0
-  fi
-
-  big_console_header "ruby-lint plugin: ${PATCH_BRANCH}"
-
-  start_clock
-
-  ruby_lint_exec branch
-
-  # keep track of how much as elapsed for us already
-  RUBY_LINT_TIMER=$(stop_clock)
-  return 0
-}
-
-## @description  Calculate the differences between the specified files
-## @description  using columns and output it to stdout
-## @audience     private
-## @stability    evolving
-## @replaceable  no
-## @param        branchlog
-## @param        patchlog
-## @return       differences
-function ruby_lint_calcdiffs
-{
-  declare orig=$1
-  declare new=$2
-  declare tmp=${PATCH_DIR}/pl.$$.${RANDOM}
-  declare j
-
-  # first, strip filenames:line:
-  # this keeps column: in an attempt to increase
-  # accuracy in case of multiple, repeated errors
-  # since the column number shouldn't change
-  # if the line of code hasn't been touched
-  cut -f4- -d: "${orig}" > "${tmp}.branch"
-  cut -f4- -d: "${new}" > "${tmp}.patch"
-
-  # compare the errors, generating a string of line
-  # numbers. Sorry portability: GNU diff makes this too easy
-  "${DIFF}" --unchanged-line-format="" \
-     --old-line-format="" \
-     --new-line-format="%dn " \
-     "${tmp}.branch" \
-     "${tmp}.patch" > "${tmp}.lined"
-
-  # now, pull out those lines of the raw output
-  # shellcheck disable=SC2013
-  for j in $(cat "${tmp}.lined"); do
-    head -"${j}" "${new}" | tail -1
-  done
-
-  rm "${tmp}.branch" "${tmp}.patch" "${tmp}.lined" 2>/dev/null
-}
-
-function ruby_lint_postapply
-{
-  declare i
-  declare numPrepatch
-  declare numPostpatch
-  declare diffPostpatch
-  declare fixedpatch
-  declare statstring
-
-  if ! verify_needed_test ruby_lint; then
-    return 0
-  fi
-
-  big_console_header "ruby-lint plugin: ${BUILDMODE}"
-
-  start_clock
-
-  # add our previous elapsed to our new timer
-  # by setting the clock back
-  offset_clock "${RUBY_LINT_TIMER}"
-
-  ruby_lint_exec patch
-
-  # shellcheck disable=SC2016
-  RUBY_LINT_VERSION=$("${RUBY_LINT}" -v | "${AWK}" '{print $2}')
-  add_footer_table ruby-lint "${RUBY_LINT_VERSION}"
-
-  calcdiffs \
-    "${PATCH_DIR}/branch-ruby-lint-result.txt" \
-    "${PATCH_DIR}/patch-ruby-lint-result.txt" \
-      ruby_lint \
-      > "${PATCH_DIR}/diff-patch-ruby-lint.txt"
-  diffPostpatch=$("${AWK}" -F: 'BEGIN {sum=0} 4<NF {sum+=1} END {print sum}' "${PATCH_DIR}/diff-patch-ruby-lint.txt")
-
-  # shellcheck disable=SC2016
-  numPrepatch=$("${AWK}" -F: 'BEGIN {sum=0} 4<NF {sum+=1} END {print sum}' "${PATCH_DIR}/branch-ruby-lint-result.txt")
-
-  # shellcheck disable=SC2016
-  numPostpatch=$("${AWK}" -F: 'BEGIN {sum=0} 4<NF {sum+=1} END {print sum}' "${PATCH_DIR}/patch-ruby-lint-result.txt")
-
-  ((fixedpatch=numPrepatch-numPostpatch+diffPostpatch))
-
-  statstring=$(generic_calcdiff_status "${numPrepatch}" "${numPostpatch}" "${diffPostpatch}"
)
-
-  if [[ ${diffPostpatch} -gt 0 ]] ; then
-    add_vote_table -1 ruby-lint "${BUILDMODEMSG} ${statstring}"
-    add_footer_table ruby-lint "@@BASE@@/diff-patch-ruby-lint.txt"
-    return 1
-  elif [[ ${fixedpatch} -gt 0 ]]; then
-    add_vote_table +1 ruby-lint "${BUILDMODEMSG} ${statstring}"
-    return 0
-  fi
-
-  add_vote_table +1 ruby-lint "There were no new ruby-lint issues."
-  return 0
-}
-
-function ruby_lint_postcompile
-{
-  declare repostatus=$1
-
-  if [[ "${repostatus}" = branch ]]; then
-    ruby_lint_preapply
-  else
-    ruby_lint_postapply
-  fi
-}


Mime
View raw message