Adjust md tab width to work better cross-markdown-parser (#124)

We're running into issues with md handlers that expect this kind of 4-space indent. It should be cross-compatible with GH, so switch, even though it feels a little churny.

Manual edits are to:

- .prettierrc.yaml:
    - rename from .prettierrc
    - add tabWidth (primary change)
    - add trailingComma (fix vimPrettier skew)
- contribution_tools.md: Fix remarks about .prettierrc.yaml
- pre-commit-toc.js: indent, bullets
- pre-commit-proposal-list.py: indent of output

The rest is the result of `pre-commit run --all-files`

Unfortunately this'll probably depend on the change being propagated into PR branches, so I wouldn't be surprised if we see regressions for a bit. We'll also need to nudge people to update .vimrc's. Hopefully the pre-commit GH action helps catch issues.
This commit is contained in:
Jon Meow
2020-07-27 10:47:38 -07:00
committed by GitHub
parent 435ed95ab2
commit be116a46c9
26 changed files with 1278 additions and 1238 deletions
+2 -2
View File
@@ -38,11 +38,11 @@ if __name__ == "__main__":
print("ERROR: %s doesn't have a title on the first line." % file)
error = True
proposals.append(
"- [%s - %s](%s)" % (file_match[1], title_match[1], file)
"- [%s - %s](%s)" % (file_match[1], title_match[1], file)
)
decision_file = "p%s-decision.md" % file_match[1]
if os.path.exists(os.path.join(proposal_dir, decision_file)):
proposals.append(" - [Decision](%s)" % decision_file)
proposals.append(" - [Decision](%s)" % decision_file)
# We print batched errors for usability, but still need to exit with
# failure.
if error:
+4 -2
View File
@@ -46,8 +46,10 @@ for (var i = 0; i < files.length; ++i) {
continue;
}
// Do the toc substitution.
newContent = mdtoc.insert(newContent, { bullets: '-' });
// Do the toc substitution. Resulting indents will look like:
// - H1
// - H2
newContent = mdtoc.insert(newContent, { indent: ' ', bullets: '- ' });
if (oldContent != newContent) {
console.log(`Updating ${file}`);