Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Enable ruff exception rules (TRY, EM, BLE)

Đang mở
#3,912 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

The issue names no specific files. Start by enabling the TRY, EM and BLE rule groups in the ruff lint configuration and listing the violations they report. Each fix needs a judgment call: narrowing a broad except, moving raises out of try blocks, or keeping a Pydantic validator's exception type unchanged. Done when ruff passes with these rules on and the existing tests pass, with message text and published schemas unchanged.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Phase 1 step 1.8, group 5 of the rules workstream: enable ruff's exception rules (TRY, EM, BLE).

  • Messages: build each exception message before the raise (EM, TRY003).
  • Raises inside try blocks: move them into helpers so a handler can't catch its own raise (TRY301, TRY300).
  • Broad catches: decide each except Exception (BLE001). Narrow it where the possible errors are known; otherwise keep it with an inline reason.
  • Exception types: use TypeError for type checks (TRY004) unless a caller, a boundary or a test depends on the current type. Never change the type raised inside a Pydantic validator, where TypeError turns a validation error into a 500.

Message text and published schemas must not change.

Ngôn ngữ chính
Python
Star
18
Fork
33
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PolicyEngine/policyengine-api

Tất cả issue của PolicyEngine/policyengine-api

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.