python / python/cpython

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

オープン
#95,472 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

topic-XML type-feature
主要言語
Python
スター
77.2k
フォーク
36k
PR マージ指標
PR 指標を取得中

説明

(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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issueで言及されている既存のpull requestと、それによって変更されるxml.etree.ElementTreeのフォーマット動作を確認してください。呼び出し側がXML宣言の引用符と空要素のフォーマットを独立して制御でき、示されている両方の例をカバーできた時点で作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
backend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
15/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。