Mercurial > hg
comparison contrib/relnotes @ 43659:99e231afc29c
black: blacken scripts
test-check-format.t doesn't appear to detect Python scripts with shebangs.
But my editor which is configured to auto run black on Python files does
and it appears some files are not blackened.
This commit blackens scripts that need it.
# skip-blame reformatting
Differential Revision: https://phab.mercurial-scm.org/D7420
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 14 Nov 2019 20:35:11 -0800 |
parents | 530d211ae9a8 |
children |
comparison
equal
deleted
inserted
replaced
43658:0796e266d26b | 43659:99e231afc29c |
---|---|
96 (r"phases|status|summary|amend|tag|help|verify", "commands"), | 96 (r"phases|status|summary|amend|tag|help|verify", "commands"), |
97 (r"rebase|mq|convert|eol|histedit|largefiles", "extensions"), | 97 (r"rebase|mq|convert|eol|histedit|largefiles", "extensions"), |
98 (r"shelve|unshelve", "extensions"), | 98 (r"shelve|unshelve", "extensions"), |
99 ] | 99 ] |
100 | 100 |
101 | |
101 def wikify(desc): | 102 def wikify(desc): |
102 desc = desc.replace("(issue", "(Bts:issue") | 103 desc = desc.replace("(issue", "(Bts:issue") |
103 desc = re.sub(r"\b([0-9a-f]{12})\b", r"Cset:\1", desc) | 104 desc = re.sub(r"\b([0-9a-f]{12})\b", r"Cset:\1", desc) |
104 # stop ParseError from being recognized as a (nonexistent) wiki page | 105 # stop ParseError from being recognized as a (nonexistent) wiki page |
105 desc = re.sub(r" ([A-Z][a-z]+[A-Z][a-z]+)\b", r" !\1", desc) | 106 desc = re.sub(r" ([A-Z][a-z]+[A-Z][a-z]+)\b", r" !\1", desc) |
106 # prevent wiki markup of magic methods | 107 # prevent wiki markup of magic methods |
107 desc = re.sub(r"\b(\S*__\S*)\b", r"`\1`", desc) | 108 desc = re.sub(r"\b(\S*__\S*)\b", r"`\1`", desc) |
108 return desc | 109 return desc |
110 | |
109 | 111 |
110 def main(): | 112 def main(): |
111 desc = "example: %(prog)s 4.7.2 --stoprev 4.8rc0" | 113 desc = "example: %(prog)s 4.7.2 --stoprev 4.8rc0" |
112 ap = argparse.ArgumentParser(description=desc) | 114 ap = argparse.ArgumentParser(description=desc) |
113 ap.add_argument( | 115 ap.add_argument( |
198 print("\n=== Internal API Changes ===\n") | 200 print("\n=== Internal API Changes ===\n") |
199 | 201 |
200 for d in sorted(apis): | 202 for d in sorted(apis): |
201 print(" * %s" % d) | 203 print(" * %s" % d) |
202 | 204 |
205 | |
203 if __name__ == "__main__": | 206 if __name__ == "__main__": |
204 main() | 207 main() |