support ignore for blocks of code
Maintainer thường phản hồi trong vòng 1 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
- 30/100
Hướng nghiên cứu
Start by reading how the existing single-line ignore comment is handled and checking its tests. Clarify the expected on/off comment syntax and scope, then implement the block-ignore behavior and add tests showing that words inside the block are ignored while words outside it are still checked.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is the follow-up issue of #1212. It is now possible to ignore a single line from a file by adding # codspell: ignore comment.
Would it be possible to continue to mimick what black is doing and implement an on/off comment.
It's easier to understand with a real life example:
in my lib I need to gather some data from USDA wich associate a US state to a 2 letter code. I thus store a boring dictionnary at the start of my module:
# fmt: off
ASSET_CODES = {
"Alabama": "AL", "Arkansas": "AR", "Arizona": "AZ", "California": "CA", "Colorado": "CO",
"Connecticut": "CT", "Delaware": "DE", "Georgia": "GA", "Florida": "FL", "Iowa": "IA", "Idaho": "ID",
"Illinois": "IL", "Indiana": "IN", "Kansas": "KS", "Kentucky": "KY", "Louisiana": "LA", "Massachusetts": "MA",
"Maryland": "MD", "Maine": "ME", "Michigan": "MI", "Minnesota": "MN", "Missouri": "MO", "Mississippi": "MS",
"Montana": "MT", "Nebraska": "NE", "New Hampshire": "NH", "New Jersey": "NJ", "New Mexico": "NM",
"Nevada": "NV", "New York": "NY", "North Carolina": "NC", "North Dakota": "ND", "Ohio": "OH", "Oklahoma": "OK", # codespell: ignore
"Oregon": "OR", "Pennsylvania": "PA", "Rhode Island": "RI", "South Carolina": "SC", "South Dakota": "SD",
"Tennessee": "TN", "Texas": "TX", "Utah": "UT", "Vermont": "VT", "Virginia": "VA", "Washington": "WA",
"West Virginia": "WV", "Wisconsin": "WI", "Wyoming": "WY",
}
# fmt: on
When I run the code spell pre-commit, it falls on "ND" which is the code for Nevada and offers me to replace it with "AND" or "2ND".
The codespell ignore comments is perfectly doing it's job but I lack visibility. If you look carefully at my example, the comments #fmt: off and #fmt: on are deactivating black for the whole length of the dict. Would it be possible to implement such a comment for codespell ?
- Ngôn ngữ chính
- Python
- Star
- 2.4k
- Fork
- 531
- Merge trung bình
- 15 giờ 5 phút
- Pull request đã merge (30 ngày)
- 18
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Không có 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.
Issue khác của codespell-project/codespell
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
codespell-project/codespell#3997 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
No error when beginning with 'Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
codespell-project/codespell#3965 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add "marcos"Có thể đã có người làm @ekanshul đã nhận 19 ngày trước. Đang mởdictionary
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
codespell-project/codespell#3920 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
question
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
codespell-project/codespell#4005 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
duplicate question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
codespell-project/codespell#3998 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codespell-project/codespell
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/agent-lightning#661 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/profiles comp/cli P3 type/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NousResearch/hermes-agent#146372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
GeoSeries scale and skew tests fail with pytest 9.2.0Có thể đã có người làm @jiayuasu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày