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

Document how to test plugins

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

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

Đá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
52/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu với tài liệu plugin-development/formatters hiện có và ngữ cảnh chuyển đổi từ flake8 2.x sang 3.x được mô tả trong issue. Viết tài liệu về một ví dụ hoàn chỉnh bao quát các entrypoint hợp lệ của function hoặc class, kiểm thử một string với một check và chạy các check tiêu chuẩn mà không dùng subprocess. Công việc được coi là hoàn tất khi ví dụ trả lời cả ba câu hỏi và phù hợp với một PR về tài liệu.

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

Mô tả

component:docs component:legacy-api

In GitLab by @stephenfin on May 23, 2019, 03:07

I'm trying to migrate hacking from flake8 2.x to 3.x and finding it extremely difficult to do so because the internals of the flake8 have changed so drastically between these versions (plus hacking does some stuff that's too smart for its own good, IMO). The flake8 documentation provides some introductory text on plugins, including a guide on writing a "formatting type" plugin (though it doesn't explain what a formatting plugin actually is...) but there's nothing about testing this or even what type of class or function the entrypoints should point to. The biggest issue I have is that I want to run flake8 in it entirety (i.e. with both the standard checks and my plugin enabled) on a test string, but there doesn't appear to be anyway to do this.

Would it be possible to get a small worked example that demonstrates:

  • What the entrypoint should look like (i.e. if it can be a Python function, a class, or both)
  • How you can test a string against only a single check
  • How you can test a string against flake8's standard checks (without having to resort to a subprocess call)

I'll happily submit a documentation PR based on this example, if it would be helpful.

Ngôn ngữ chính
Python
Star
3.8k
Fork
356
Merge trung bình
3 giờ 25 phút
Pull request đã merge (30 ngày)
5

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 PyCQA/flake8

Tất cả issue của PyCQA/flake8

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.