Convert regular exceptions into ExpressionError
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 38/100
調査の方向性
license_expression/init.py の Licensing.validate と、traceback に示されている parse 呼び出しから始めます。'(Apache-2.0) AND ()' 式を再現し、その後、検証によって不正な形式の式がパーサーの IndexError を露出させるのではなく、result.errors を通じて報告されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
I currently try to run validation of SPDX expression from arbitrary inputs. If something is wrong with the expression, I would have expected it to always populate the errors attribute instead of raising exceptions. Apparently, this is not the case in every situation.
Let's consider the following snippet:
from license_expression import get_spdx_licensing
licensing = get_spdx_licensing()
expression = '(Apache-2.0) AND ()'
result = licensing.validate(expression)
print(result.errors)
This fails with an IndexError during validation:
[...]
File "/home/user/lib/python3.9/site-packages/license_expression/__init__.py", line 778, in validate
parsed_expression = self.parse(expression, strict=strict)
File "/home/user/lib/python3.9/site-packages/license_expression/__init__.py", line 545, in parse
expression = super(Licensing, self).parse(tokens)
File "/home/user/lib/python3.9/site-packages/boolean/boolean.py", line 316, in parse
ast[0].append(ast[2])
IndexError: list index out of range
- 主要言語
- Python
- スター
- 74
- フォーク
- 38
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aboutcode-org/license-expression のほかの issue
-
Bump setuptools dependency and remove wheel dependency対応中かも @devnishantt が 34 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
aboutcode-org/license-expression#132 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
aboutcode-org/license-expression#124 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
aboutcode-org/license-expression#121 · コメント 5 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
aboutcode-org/license-expression#120 · コメント 2 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
aboutcode-org/license-expression#111 · コメント 4 件 ·
aboutcode-org/license-expression の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pytest-dev/pyfakefs#1367 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
IFEvalG exclude_word_harder misses the keyword next to punctuation, at the start or end of the text, and in other letter case対応中かも @damienen が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
allenai/open-instruct#2151 ·
メンテナーはふだん 1 日以内に返信
-
feat(plan): support convertorLabels and convertorAffinity in Plan resource対応中かも @AmenB が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
RedHatQE/openshift-python-wrapper#2849 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 25 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libnativeapi/nativeapi#21 ·