python / python/cpython

`xml.etree.ElementTree` — doesn't allow specifying fine-grained formatting controls

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

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

topic-XML type-feature
Ngôn ngữ chính
Python
Star
77.2k
Fork
36k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

(Note: I already have a PR and this is a tracking issue.)

Enhancement

XML is maddening from a Git perspective, as if multiple tools will edit it, you'll get lots of lines in the diff that aren't needed.

For example:

diff --git a/sources/designspace/Besley.designspace b/sources/designspace/Besley.designspace
index d247944..eecb985 100644
--- a/sources/designspace/Besley.designspace
+++ b/sources/designspace/Besley.designspace
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version='1.0' encoding='UTF-8'?>

And:

diff --git a/sources/designspace/Besley.designspace b/sources/designspace/Besley.designspace
index d247944..9d570dd 100644
--- a/sources/designspace/Besley.designspace
+++ b/sources/designspace/Besley.designspace
@@ -10,15 +10,15 @@
       <map input="800" output="766"/>
       <map input="900" output="900"/>
     </axis>
-    <axis tag="wdth" name="Width" minimum="75" maximum="100" default="100"></axis>
+    <axis tag="wdth" name="Width" minimum="75" maximum="100" default="100" />
   </axes>
 
   <sources>
 
     <source filename="../ufo/Besley-Book.ufo" name="Besley Regular" familyname="Besley" stylename="Regular">
       <location>
-        <dimension name="Weight" xvalue="400"/>
-        <dimension name="Width" xvalue="100"/>
+        <dimension name="Weight" xvalue="400" />
+        <dimension name="Width" xvalue="100" />
       </location>
     </source>
 

There are likely other issues, but I only needed to solve these two.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu bằng việc xem xét pull request hiện có được đề cập trong issue và hành vi định dạng của xml.etree.ElementTree mà nó thay đổi. Công việc được hoàn tất khi các bên gọi có thể kiểm soát độc lập việc đặt dấu ngoặc kép cho khai báo XML và cách định dạng phần tử rỗng, với độ bao phủ cho cả hai ví dụ được nêu.

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
backend
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
15/100

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.