Do not check LSP compatibility of `plugin_generated` nodes
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 20.6k
- Fork
- 3.3k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
Feature
When plugins add some methods or variables, it should be their responsibility to decide whether the override should be checked for LSP compat.
Pitch
This is already hitting the pydantic plugin, for example, resulting in some very weird workaround involving adding an unresolved classmethod decorator that shouldn't be there at all.
In many cases a plugin-generated method has narrower signature than the base class definition, and there is no way to make it compatible with super definition (which can't be removed either to support other typecheckers). We still want a plugin to be able to define such a signature without introducing noise, assuming that the plugin author is already aware that such behavior violates LSP.
It should become easy to run LSP checks manually from plugin code. Checker API should be extended to include the necessary methods, or we'll see increased use of mypy internals or unexpectedly omitting LSP checks altogether because they are too tricky to implement correctly.
Hướng dẫn đóng góp
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.
Hướng nghiên cứu
Bắt đầu bằng cách lần theo các bước kiểm tra tính tương thích LSP của mypy và cách các node do plugin tạo ra được biểu diễn. Xác định checker API cần thiết để plugin có thể chạy các bước kiểm tra này một cách thủ công, đồng thời bổ sung độ bao phủ cho thấy các override do plugin tạo ra không phát sinh chẩn đoán LSP tự động, trong khi các override thông thường vẫn được kiểm tra.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- compilers, devtools
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100