Add a mode which preserves carriage returns
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo cách các tệp .ss và định dạng .ss.asar được tải, phân tích và ghi, bao gồm cả việc chuẩn hóa ký tự xuống dòng được mô tả ở đây. Xác định hành vi của mode về việc giữ lại \r và round-trip các tệp mà không thay đổi các quy tắc escaping khác; hoàn thành khi các snapshot .ss.asar giữ lại ký tự xuống dòng, trong khi các snapshot thông thường vẫn giữ hành vi hiện tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Here are two important properties of the .ss snapshot files:
- exactly character-for-character accurate, no slop around leading or trailing whitespace, no forbidden characters
- what you see in the snapshot file is exactly what you get, except for the following escaping rules which preserve the above
- the following characters are escaped:
𐝃->𐝃𐝃,𐝁->𐝃𐝁(they are from an untranslated dead language) - if the first character on a line within a snapshot is
╔then it is replaced with𐝁(this preserves ASCII art within snapshots)
- the following characters are escaped:
This combination of character-accurate + WYSIWYG breaks down in only one place - line endings. You can't see them, and git's complex and poorly understood line-ending-mutation rules mean that most teams can't reliably do source control that differentiates between \n and \r\n.
Rather than randomly punch users in the face with this triviality, we do the following:
- Internally, every text-based snapshot in spotless-snapshot has a
.replace("\r", ""), so snapshots will never fail because of line-ending differences - New
.ssfiles are always written using\nline endings - If an
.ssfile is loaded from disk with\r\n, it is converted and parsed using\n, but will be written back to disk as\r\n
However, this means that the snapshots are not exactly character-for-character accurate because they do not preserve \r. For users that want to preserve \r, we could add a mode which preserves the \r character if the user uses the .ss.asar format
- #1
Adding support for storing \r within .ss files might be possible (maybe encode them as 𐝃r?), but doesn't seem like a good idea.
- Ngôn ngữ chính
- Kotlin
- Star
- 101
- Fork
- 18
- Merge trung bình
- 6 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 5
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 diffplug/selfie
-
Selfie JVM Snapshot Garbage Collection is overly zealous when using multiple test suites in gradle Đang mởbug jvm
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
enhancement jvm
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
bug jvm
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
bug docs jvm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 50/100
-
bug jvm py
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
Tất cả issue của diffplug/selfie
Issue tương tự
-
Flaky: a relaunched catch-up replay can still report catching up right after its marker is written Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
johanhaleby/occurrent#1134 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Blockstream/green_android#313 ·
-
autoteam community team/use
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
android: AlbumArtistDetailViewModel keeps groupKeys of albums that disappeared in expandedAlbums Đang mởtask
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
aaif-goose/goose#12496 ·