With the previous commit, they're in effect sorted by the types of the interface changes. As a lazy measure to sort changes by the breakages they cause, sort the content reverse alphabetically, which works OK by accident.
Unified · Split
| @@ -34,18 +34,19 @@ def add_new_entries(docs_dir, out, git): · 33 unmodified lines | ||
| 34 | 34 | timestamp = check_output([git, "log", "--format=%ct", "-n", "1", "--", |
| 35 | 35 | f], encoding="UTF-8") |
| 36 | 36 | if timestamp: |
| 37 | − files.append((f, timestamp)) | |
| 37 | + content = f.read_text() | |
| 38 | + files.append(content) | |
| 38 | 39 | else: |
| 39 | 40 | print(f"Skipping file not tracked by git: {f.name}") |
| 40 | 41 | |
| 41 | − files.sort(key=lambda x: x[1]) | |
| 42 | − for file in files: | |
| 43 | − with open(file[0].resolve(), "r") as f: | |
| 44 | − for line in f: | |
| 45 | − line = textwrap.fill(line.rstrip(), width=80, | |
| 46 | − initial_indent=" - ", | |
| 47 | − subsequent_indent=" ") | |
| 48 | − out.write(line + "\n") | |
| 42 | + # Sort the changes by "severity", which roughly corresponds to | |
| 43 | + # alphabetical order by accident (e.g. remove > deprecate > change > add) | |
| 44 | + for file in reversed(sorted(files)): | |
| 45 | + for line in file.splitlines(): | |
| 46 | + line = textwrap.fill(line.rstrip(), width=80, | |
| 47 | + initial_indent=" - ", | |
| 48 | + subsequent_indent=" ") | |
| 49 | + out.write(line + "\n") | |
| 49 | 50 | |
| 50 | 51 | if __name__ == "__main__": |
| 51 | 52 | if len(sys.argv) < 2: |