Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Main.scala (OpenWhisk admin tool) contains MIT-licensed code from Scallop without attribution

已關閉 適合新手
#264 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
72/100
Issue 類型
文件
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
scala
領域
cli, documentation

研究方向

從 build/openwhisk/tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala 開始,並將 Scallop 3.3.2 中 ScallopConf.scala 的第 77-85 行與 printErr 進行比較。檢查頂層 LICENSE 以及相關 issue #259 和 #260。完成的標準是:替換複製的實作並移除其歸屬註解,或保留該實作,同時加入所需的 Scallop MIT 聲明和檔案參照。

由索引模型根據 Issue 內容生成。

描述

build/openwhisk/tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala (vendored from Apache OpenWhisk, shipped in the 0.9.0-incubating-RC7 source release) contains code copied from Scallop, which is MIT-licensed:

  private def printErr(message: String): Unit = {
    //Taken from ScallopConf
    if (overrideColorOutput.value.getOrElse(System.console() != null)) {
      Console.err.println("[\u001b[31m%s\u001b[0m] Error: %s" format (printedName, message))
    } else {
      // no colors on output
      Console.err.println("[%s] Error: %s" format (printedName, message))
    }
  }

This is the default errorMessageHandler from Scallop 3.3.2 (the version the admin tool depends on), jvm/src/main/scala/org.rogach.scallop/ScallopConf.scala lines 77-85, minus the final sys.exit(1):

  errorMessageHandler = { message =>
    if (overrideColorOutput.value.getOrElse(System.console() != null)) {
      Console.err.println("[\u001b[31m%s\u001b[0m] Error: %s" format (printedName, message))
    } else {
      // no colors on output
      Console.err.println("[%s] Error: %s" format (printedName, message))
    }
    sys.exit(1)
  }

Scallop is licensed under the MIT License, Copyright (C) 2012 Platon Pronko and Chris Hodapp. MIT is Category A, so it can be included, but the MIT licence requires its copyright and permission notice to be kept with the copied code. Currently the file only carries the ASF header, and the top-level LICENSE does not mention Scallop.

Suggested fix, either:

  1. Rewrite printErr independently (it is a few lines of error printing), and drop the "Taken from ScallopConf" comment; or
  2. Keep it and add a LICENSE entry for Scallop (MIT, with its copyright line and licence text), noting the file it is used in.

The same code is in upstream Apache OpenWhisk (tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala). Related: #259, #260.

主要語言
Python
星號
577
分支
29
平均合併
3 天 39 分鐘
30 天內合併 PR
5

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

apache/openserverless 的其他 Issue

查看 apache/openserverless 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。