yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [yetus] 04/04: YETUS-686. update homebrew formula with missing dependencies
Date Wed, 09 Jan 2019 23:39:37 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

commit 1d9f8d67239434d0405459452ba6ef0d16119300
Author: Allen Wittenauer <aw@apache.org>
AuthorDate: Sun Dec 30 22:00:36 2018 -0800

    YETUS-686. update homebrew formula with missing dependencies
    
    Signed-off-by: Sean Busbey <busbey@apache.org>
---
 Formula/.rubocop.yml | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Formula/yetus.rb     |  52 +++++++++---------
 pom.xml              |   2 +
 3 files changed, 178 insertions(+), 25 deletions(-)

diff --git a/Formula/.rubocop.yml b/Formula/.rubocop.yml
new file mode 100644
index 0000000..864869e
--- /dev/null
+++ b/Formula/.rubocop.yml
@@ -0,0 +1,149 @@
+# BSD 2-Clause License
+
+# Copyright (c) 2009-present, Homebrew contributors
+# All rights reserved.
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+
+# * Redistributions of source code must retain the above copyright notice, this
+#   list of conditions and the following disclaimer.
+
+# * Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Taken from Homebrew @ Dec 3, 2018. Modified to pass yamllint
+#
+---
+# make our hashes consistent
+Layout/AlignHash:
+  EnforcedHashRocketStyle: table
+  EnforcedColonStyle: table
+
+# `system` is a special case and aligns on second argument
+Layout/AlignParameters:
+  Enabled: false
+
+# favour parens-less DSL-style arguments
+Lint/AmbiguousOperator:
+  Enabled: false
+
+# this is a bit less "floaty"
+Layout/CaseIndentation:
+  EnforcedStyle: end
+
+# this is a bit less "floaty"
+Layout/EndAlignment:
+  EnforcedStyleAlignWith: start_of_line
+
+# conflicts with DSL-style path concatenation with `/`
+Layout/SpaceAroundOperators:
+  Enabled: false
+
+# Auto-correct is broken (https://github.com/rubocop-hq/rubocop/issues/6300).
+Layout/EmptyLineAfterGuardClause:
+  Enabled: false
+
+# Auto-correct is broken (https://github.com/rubocop-hq/rubocop/issues/6258)
+# and layout is not configurable
+# (https://github.com/rubocop-hq/rubocop/issues/6254).
+Layout/RescueEnsureAlignment:
+  Enabled: false
+
+# favour parens-less DSL-style arguments
+Lint/AmbiguousBlockAssociation:
+  Enabled: false
+
+# so many of these in formulae and can't be autocorrected
+# TODO: fix these as `ruby -w` complains about them.
+Lint/AmbiguousRegexpLiteral:
+  Enabled: false
+
+# assignment in conditions are useful sometimes
+# TODO: add parentheses for these and remove
+Lint/AssignmentInCondition:
+  Enabled: false
+
+# we output how to use interpolated strings too often
+Lint/InterpolationCheck:
+  Enabled: false
+
+# so many of these in formulae and can't be autocorrected
+Lint/ParenthesesAsGroupedExpression:
+  Enabled: false
+
+# most metrics don't make sense to apply for formulae/taps
+Metrics/AbcSize:
+  Enabled: false
+Metrics/ClassLength:
+  Enabled: false
+Metrics/CyclomaticComplexity:
+  Enabled: false
+Metrics/MethodLength:
+  Enabled: false
+Metrics/ModuleLength:
+  Enabled: false
+Metrics/PerceivedComplexity:
+  Enabled: false
+
+# GitHub diff UI wraps beyond 118 characters (so that's the goal)
+Metrics/LineLength:
+  Max: 170
+  # ignore manpage comments and long single-line strings
+  IgnoredPatterns: ['#: ', ' url "', ' mirror "', ' plist_options :']
+
+# our current conditional style is established
+# TODO: enable this when possible
+Style/ConditionalAssignment:
+  Enabled: false
+
+# most of our APIs are internal so don't require docs
+Style/Documentation:
+  Enabled: false
+
+# we want to add this slowly and manually
+# TODO: add to more files
+Style/FrozenStringLiteralComment:
+  Enabled: false
+
+# so many of these in formulae and can't be autocorrected
+Style/GuardClause:
+  Enabled: false
+
+# depends_on a: :b looks weird in formulae.
+Style/HashSyntax:
+  EnforcedStyle: hash_rockets
+  Exclude:
+    - '**/cmd/*.rb'
+
+# ruby style guide favorite
+Style/StringLiterals:
+  EnforcedStyle: double_quotes
+
+# consistency with above
+Style/StringLiteralsInInterpolation:
+  EnforcedStyle: double_quotes
+
+# make things a bit easier to read
+Style/TernaryParentheses:
+  EnforcedStyle: require_parentheses_when_complex
+
+# messes with existing plist/caveats style
+Style/TrailingBodyOnMethodDefinition:
+  Enabled: false
+
+# a bit confusing to non-Rubyists but useful for longer arrays
+Style/WordArray:
+  MinSize: 4
diff --git a/Formula/yetus.rb b/Formula/yetus.rb
index 0be094d..581adab 100644
--- a/Formula/yetus.rb
+++ b/Formula/yetus.rb
@@ -16,35 +16,37 @@
 #
 # Homebrew formula to install Apache Yetus
 class Yetus < Formula
-  desc 'Enable contribution and release processes for software projects'
-  homepage 'https://yetus.apache.org/'
-  url 'https://www.apache.org/dyn/closer.lua?path=/yetus/0.8.0/yetus-0.8.0-bin.tar.gz'
-  sha256 'dea3bcec00c54ff27bcdc3f829749c3ea13bacdcd048792f6aae486ecf2e022e'
+  desc "Enable contribution and release processes for software projects"
+  homepage "https://yetus.apache.org/"
+  url "https://www.apache.org/dyn/closer.lua?path=/yetus/0.8.0/yetus-0.8.0-bin.tar.gz"
+  sha256 "dea3bcec00c54ff27bcdc3f829749c3ea13bacdcd048792f6aae486ecf2e022e"
 
-  option 'with-all', 'Build with all dependencies. Note that some dependencies such as '\
-    'Perl::Critic, Pylint, RuboCop and ruby-lint still need to be installed manually.'
+  option "with-all", "Build with all dependencies. Note that some dependencies such as "\
+    "Perl::Critic, Pylint, RuboCop and ruby-lint still need to be installed manually."
 
   dependencies = [
     # programming languages
     :java,
-    'scala',
+    "scala",
 
     # build tools
-    'ant',
-    'autoconf',
-    'automake',
-    'cmake',
-    'libtool',
-    'gradle',
-    'maven',
+    "ant",
+    "autoconf",
+    "automake",
+    "cmake",
+    "libtool",
+    "gradle",
+    "maven",
 
     # test tools
-    'findbugs',
-    'shellcheck'
+    "hadolint",
+    "shellcheck",
+    "spotbugs",
+    "yamllint"
   ]
 
   dependencies.each do |dependency|
-    if build.with?('all')
+    if build.with?("all")
       depends_on dependency
     else
       depends_on dependency => :optional
@@ -52,17 +54,17 @@ class Yetus < Formula
   end
 
   def install
-    rm Dir['bin/*.{bat,cmd,dll,exe}']
-    inreplace Dir['bin/*'], '$(dirname -- "${BASH_SOURCE-0}")/..', libexec
-    libexec.install Dir['*']
+    rm Dir["bin/*.{bat,cmd,dll,exe}"]
+    inreplace Dir["bin/*"], '$(dirname -- "${BASH_SOURCE-0}")/..', libexec
+    libexec.install Dir["*"]
     bin.install_symlink Dir["#{libexec}/bin/*"]
   end
 
   test do
-    system "#{bin}/qbt", '--version'
-    system "#{bin}/releasedocmaker", '-V'
-    system "#{bin}/shelldocs", '-V'
-    system "#{bin}/smart-apply-patch", '--version'
-    system "#{bin}/test-patch", '--version'
+    system "#{bin}/qbt", "--version"
+    system "#{bin}/releasedocmaker", "-V"
+    system "#{bin}/shelldocs", "-V"
+    system "#{bin}/smart-apply-patch", "--version"
+    system "#{bin}/test-patch", "--version"
   end
 end
diff --git a/pom.xml b/pom.xml
index 68e28a7..2d79cc6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -212,11 +212,13 @@
       <plugin>
         <groupId>org.apache.rat</groupId>
         <artifactId>apache-rat-plugin</artifactId>
+        <version>0.13</version>
         <configuration>
           <excludeSubprojects>false</excludeSubprojects>
           <excludes>
             <exclude>.pylintrc</exclude>
             <exclude>.rubocop.yml</exclude>
+            <exclude>Formula/.rubocop.yml</exclude>
           </excludes>
         </configuration>
       </plugin>


Mime
View raw message