<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLVM's YAML output has lots of trailing whitespace"
   href="https://bugs.llvm.org/show_bug.cgi?id=35111">35111</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM's YAML output has lots of trailing whitespace
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rnk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bigcheesegs@gmail.com, davide@freebsd.org, llvm-bugs@lists.llvm.org, ruiu@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is observable in any file produced by obj2yaml, and is annoying when
checking in test YAML test cases. Git and other tools complain about trailing
whitespace, and it would be great if we could silence that without manually
removing the whitespace.

The bug is in Output::preflightKey, which pads out the column after emitting
the key name:
  bool Output::preflightKey(const char *Key, bool Required, bool SameAsDefault,
                            bool &UseDefault, void *&) {
    UseDefault = false;
    if (Required || !SameAsDefault || WriteDefaultValues) {
      auto State = StateStack.back();
      if (State == inFlowMapFirstKey || State == inFlowMapOtherKey) {
        flowKey(Key);
      } else {
        this->newLineCheck();
        this->paddedKey(Key);
      }
      return true;
    }
    return false;
  }

If there is no value or the value flows onto the next line, the padding
whitespace is left behind trailing.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>