Convert regular exceptions into ExpressionError
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Bắt đầu trong license_expression/init.py tại Licensing.validate và lệnh gọi parse được hiển thị trong traceback. Tái hiện biểu thức '(Apache-2.0) AND ()', sau đó xác minh rằng quá trình xác thực báo cáo biểu thức không đúng định dạng thông qua result.errors thay vì để lộ IndexError của parser.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 74
- Fork
- 38
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aboutcode-org/license-expression
-
Bump setuptools dependency and remove wheel dependencyCó thể đã có người làm @devnishantt đã nhận 33 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
aboutcode-org/license-expression#132 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
aboutcode-org/license-expression#124 · 3 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
aboutcode-org/license-expression#121 · 5 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
aboutcode-org/license-expression#120 · 2 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
aboutcode-org/license-expression#111 · 4 bình luận ·
Tất cả issue của aboutcode-org/license-expression
Issue tương tự
-
ReadQwen3PaperTask5 rejects correct answers that differ only in order, case, or underscore formCó thể đã có người làm @Kingpython123 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Tongyi-MAI/MobileWorld#72 ·
-
_threads/application: Update typing annotations using `pyupgrade --py311-plus`Có thể đã có người làm @gudnimg đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Health probes return 401 when authentication is enabled and the API is served under /orbCó thể đã có người làm @fgogolli đã nhận hôm nay. Đang mởarea: api priority: p2 size: S type: bug
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 75/100
finos/open-resource-broker#704 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
BCDA-APS/polar-bits#93 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
GoogleCloudPlatform/gce-rescue#218 ·
Maintainer thường phản hồi trong vòng 2 ngày