pyDiffTools 0.1.44__tar.gz → 0.1.46__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. {pydifftools-0.1.44/pyDiffTools.egg-info → pydifftools-0.1.46}/PKG-INFO +1 -1
  2. {pydifftools-0.1.44 → pydifftools-0.1.46/pyDiffTools.egg-info}/PKG-INFO +1 -1
  3. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/continuous.py +6 -6
  4. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/wrap_sentences.py +17 -13
  5. {pydifftools-0.1.44 → pydifftools-0.1.46}/pyproject.toml +1 -1
  6. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_wrap_check.py +51 -3
  7. {pydifftools-0.1.44 → pydifftools-0.1.46}/LICENSE.md +0 -0
  8. {pydifftools-0.1.44 → pydifftools-0.1.46}/MANIFEST.in +0 -0
  9. {pydifftools-0.1.44 → pydifftools-0.1.46}/README.rst +0 -0
  10. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/_quarto.yml +0 -0
  11. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/__version__.txt +0 -0
  12. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/1a724af72b16f5a9e607e12b1c721645/base.ipynb +0 -0
  13. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/1b28fc9daac9081847e5161b2c546f8a/base.ipynb +0 -0
  14. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/231f64eee282fa225d1104935cf80a24/base.ipynb +0 -0
  15. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/26e56f6b0ff54851a45145157f2f0dc4/base.ipynb +0 -0
  16. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/311fabd7029ffd050d056e2f316eb50f/base.ipynb +0 -0
  17. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/57da2021e5b156ac3adf01398201c723/base.ipynb +0 -0
  18. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/62b24ea7da75011d92b0f8924faa208d/base.ipynb +0 -0
  19. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/7f1b20d69d889514ab5d1cc92e3cb14f/base.ipynb +0 -0
  20. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/86f74c8c54a87ff892d9b15dd714e8f0/base.ipynb +0 -0
  21. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/88893b4234eac2945d9d6cb2e277f186/base.ipynb +0 -0
  22. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/9a40046ada6f582ee34af00fbdbfb417/base.ipynb +0 -0
  23. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/a1bf4d270d0641ff41faf1d7cce3439a/base.ipynb +0 -0
  24. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/a3789f7d9585a781f2a1c60ce95ff10d/base.ipynb +0 -0
  25. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/be46ecba858d39ad5f0c46902ddf1c02/base.ipynb +0 -0
  26. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/d0cbc57a12f2ccce710a5afd04cc05e7/base.ipynb +0 -0
  27. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/d3e12d320b14228f701231ae32ddd7dd/base.ipynb +0 -0
  28. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/eb434f61555438d020a6970a5dbf9ee8/base.ipynb +0 -0
  29. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/f6b0e73aa7fa029134665d4dde57e096/base.ipynb +0 -0
  30. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/f719a6e4ff09873cb0ffb06ec9d232f9/base.ipynb +0 -0
  31. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/executed/feeee244a7ce3d60e1a227eb604df823/base.ipynb +0 -0
  32. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/.jupyter_cache/global.db +0 -0
  33. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/example.qmd +0 -0
  34. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/example.tex +0 -0
  35. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/index.qmd +0 -0
  36. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/.jupyter_cache/__version__.txt +0 -0
  37. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/.jupyter_cache/executed/ca90e4df5f4f0583df6554156a68dc7f/base.ipynb +0 -0
  38. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/.jupyter_cache/global.db +0 -0
  39. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/end_vs_he_sketch.jpg +0 -0
  40. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/independent.qmd +0 -0
  41. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/index.qmd +0 -0
  42. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/tasks.qmd +0 -0
  43. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/test_include.qmd +0 -0
  44. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/subproject1/tryforerror.qmd +0 -0
  45. {pydifftools-0.1.44 → pydifftools-0.1.46}/example_notebook/project1/test_include.qmd +0 -0
  46. {pydifftools-0.1.44 → pydifftools-0.1.46}/pyDiffTools.egg-info/SOURCES.txt +0 -0
  47. {pydifftools-0.1.44 → pydifftools-0.1.46}/pyDiffTools.egg-info/dependency_links.txt +0 -0
  48. {pydifftools-0.1.44 → pydifftools-0.1.46}/pyDiffTools.egg-info/entry_points.txt +0 -0
  49. {pydifftools-0.1.44 → pydifftools-0.1.46}/pyDiffTools.egg-info/requires.txt +0 -0
  50. {pydifftools-0.1.44 → pydifftools-0.1.46}/pyDiffTools.egg-info/top_level.txt +0 -0
  51. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/__init__.py +0 -0
  52. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/bibliography.py +0 -0
  53. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/browser_lifecycle.py +0 -0
  54. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/check_numbers.py +0 -0
  55. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/citation_dialog.py +0 -0
  56. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/command_line.py +0 -0
  57. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/command_registry.py +0 -0
  58. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/comment_functions.py +0 -0
  59. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/comment_migration.py +0 -0
  60. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/comment_tags.lua +0 -0
  61. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/comment_tags_margin.lua +0 -0
  62. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/comment_tags_no_comments.lua +0 -0
  63. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/comment_toggle.js +0 -0
  64. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/comments.css +0 -0
  65. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/copy_files.py +0 -0
  66. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/diff-doc.js +0 -0
  67. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/doc_contents.py +0 -0
  68. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/flowchart/__init__.py +0 -0
  69. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/flowchart/comparison.py +0 -0
  70. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/flowchart/dot_to_yaml.py +0 -0
  71. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/flowchart/graph.py +0 -0
  72. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/flowchart/svg-pan-zoom.min.js +0 -0
  73. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/flowchart/watch_graph.py +0 -0
  74. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/flowchart/wgrph_view.js +0 -0
  75. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/forward_search.py +0 -0
  76. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/git_gd.py +0 -0
  77. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/git_gd_history.py +0 -0
  78. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/git_gd_image.py +0 -0
  79. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/git_gd_qt.py +0 -0
  80. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/html_comments.py +0 -0
  81. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/html_uncomments.py +0 -0
  82. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/log_example.py +0 -0
  83. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/match_spaces.py +0 -0
  84. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/notebook/__init__.py +0 -0
  85. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/notebook/display.py +0 -0
  86. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/notebook/fast_build.py +0 -0
  87. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/notebook/tex_to_qmd.py +0 -0
  88. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/onewordify.py +0 -0
  89. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/onewordify_undo.py +0 -0
  90. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/outline.py +0 -0
  91. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/rearrange_tex.py +0 -0
  92. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/searchacro.py +0 -0
  93. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/separate_comments.py +0 -0
  94. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/split_conflict.py +0 -0
  95. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/unseparate_comments.py +0 -0
  96. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/update_check.py +0 -0
  97. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/xml2xlsx.vbs +0 -0
  98. {pydifftools-0.1.44 → pydifftools-0.1.46}/pydifftools/zotero.py +0 -0
  99. {pydifftools-0.1.44 → pydifftools-0.1.46}/setup.cfg +0 -0
  100. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_bibliography.py +0 -0
  101. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_browser_lifecycle.py +0 -0
  102. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_check_single_use.py +0 -0
  103. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_command_line_help.py +0 -0
  104. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_comment_migration.py +0 -0
  105. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_continuous_shutdown.py +0 -0
  106. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_forward_search.py +0 -0
  107. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_git_gd_history.py +0 -0
  108. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_git_gd_image.py +0 -0
  109. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_git_gd_qt.py +0 -0
  110. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_rrng.py +0 -0
  111. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_tex_to_qmd.py +0 -0
  112. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_update_check.py +0 -0
  113. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_wrapping.py +0 -0
  114. {pydifftools-0.1.44 → pydifftools-0.1.46}/tests/test_zotero.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyDiffTools
3
- Version: 0.1.44
3
+ Version: 0.1.46
4
4
  Summary: Diff tools
5
5
  Author: J M Franck
6
6
  License: Copyright (c) 2015, jmfranck
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyDiffTools
3
- Version: 0.1.44
3
+ Version: 0.1.46
4
4
  Summary: Diff tools
5
5
  Author: J M Franck
6
6
  License: Copyright (c) 2015, jmfranck
@@ -149,10 +149,10 @@ def show_markdown_fix_dialog(report):
149
149
  if not fixes and not warnings and not layout:
150
150
  return
151
151
 
152
+ # a QApplication must exist before any widget is constructed
153
+ application = QApplication.instance() or QApplication([])
152
154
  dialog = QDialog()
153
- dialog._pydifftools_application = (
154
- QApplication.instance() or QApplication([])
155
- )
155
+ dialog._pydifftools_application = application
156
156
  dialog.setWindowTitle("Markdown source fixes")
157
157
  fixed_font = QFontDatabase.systemFont(QFontDatabase.SystemFont.FixedFont)
158
158
  # {{{ group fixes of one kind onto pages that fill the screen
@@ -372,10 +372,10 @@ def show_markdown_reload_dialog():
372
372
  QVBoxLayout,
373
373
  )
374
374
 
375
+ # a QApplication must exist before any widget is constructed
376
+ application = QApplication.instance() or QApplication([])
375
377
  dialog = QDialog()
376
- dialog._pydifftools_application = (
377
- QApplication.instance() or QApplication([])
378
- )
378
+ dialog._pydifftools_application = application
379
379
  dialog.setWindowTitle("Reload the Markdown source")
380
380
  dialog.resize(440, 150)
381
381
  layout = QVBoxLayout(dialog)
@@ -1207,8 +1207,8 @@ def apply_markdown_issue_fix(content, line_number, message):
1207
1207
  updated,
1208
1208
  before,
1209
1209
  after,
1210
- "A crossref marker was separated from its equation or figure. "
1211
- "I joined it back on.",
1210
+ "One or more crossref markers were separated from their "
1211
+ "equation or figure. I joined them back on.",
1212
1212
  )
1213
1213
  # }}}
1214
1214
  old_line = lines[index]
@@ -1239,7 +1239,8 @@ def apply_markdown_issue_fix(content, line_number, message):
1239
1239
  "".join(lines),
1240
1240
  old_line,
1241
1241
  old_line[:-1],
1242
- "A line ended with a single stray space. I removed it.",
1242
+ "One or more lines ended with a single stray space. I removed "
1243
+ "those spaces.",
1243
1244
  )
1244
1245
  if message.startswith("line too long:"):
1245
1246
  match = re.search(r"after '(.+?)' \(before '(.+?)'\); move", message)
@@ -1263,8 +1264,8 @@ def apply_markdown_issue_fix(content, line_number, message):
1263
1264
  first = old_line[:split_at].rstrip()
1264
1265
  second = old_line[split_at:].lstrip(" \t")
1265
1266
  reason = (
1266
- "This line was hard to read because it held too many words. "
1267
- "I moved the next words onto a new line."
1267
+ "One or more lines were run-on lines, longer than the line "
1268
+ "width. I moved the extra words onto new lines."
1268
1269
  )
1269
1270
  elif message.startswith("sentence ends mid-line"):
1270
1271
  boundary = SENTENCE_BOUNDARY.search(old_line)
@@ -1276,8 +1277,11 @@ def apply_markdown_issue_fix(content, line_number, message):
1276
1277
  first = old_line[: boundary.end(1)].rstrip()
1277
1278
  second = old_line[boundary.end(2) :].lstrip(" \t")
1278
1279
  reason = (
1279
- "A sentence ended, but the next sentence continued on the same "
1280
- "source line. I started it on a new line."
1280
+ "One or more sentences started in the middle of a source line. "
1281
+ "Since you can line-break the source wherever you want (only "
1282
+ "double breaks give a new paragraph), you should <b>always "
1283
+ "start sentences on new lines</b>. I started each one on a new "
1284
+ "line."
1281
1285
  )
1282
1286
  else:
1283
1287
  raise ValueError(f"No automatic fix is available for {message!r}")
@@ -1614,15 +1618,15 @@ def autofix_markdown_file(
1614
1618
  reasons = []
1615
1619
  if result["linted"]:
1616
1620
  reasons.append(
1617
- "This edit made a line too long or ended a sentence "
1618
- "mid-line. I broke it where it keeps the most lines "
1619
- "unchanged from git HEAD."
1621
+ "One or more edits made a line too long or ended a "
1622
+ "sentence mid-line. I broke those lines where they "
1623
+ "keep the most lines unchanged from git HEAD."
1620
1624
  )
1621
1625
  if result["moved"]:
1622
1626
  reasons.append(
1623
- "This edit moved a line break away from where git "
1624
- "HEAD has it. I put it back so the unchanged lines "
1625
- "stay unchanged."
1627
+ "One or more edits moved a line break away from "
1628
+ "where git HEAD has it. I put those breaks back so "
1629
+ "the unchanged lines stay unchanged."
1626
1630
  )
1627
1631
  fixes.append(
1628
1632
  {
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyDiffTools"
7
- version = "0.1.44"
7
+ version = "0.1.46"
8
8
  authors = [{ name = "J M Franck" }]
9
9
  description = "Diff tools"
10
10
  readme = "README.rst"
@@ -1,5 +1,7 @@
1
+ import os
1
2
  import re
2
3
  import subprocess
4
+ import sys
3
5
 
4
6
  import pytest
5
7
 
@@ -102,7 +104,7 @@ def test_markdown_autofix_inserts_soft_returns(tmp_path):
102
104
  assert markdown_lint_issues_from_text(fixed, wrapnumber=55) == []
103
105
  assert "First sentence ends here.\nA second sentence" in fixed
104
106
  assert any(
105
- "moved the next words" in item["reason"]
107
+ "moved the extra words" in item["reason"]
106
108
  for item in report["fixes"]
107
109
  )
108
110
 
@@ -118,7 +120,7 @@ def test_one_reported_long_line_is_fixed_at_the_suggested_word():
118
120
  assert before in source
119
121
  assert "\n" in after
120
122
  assert after in fixed
121
- assert "hard to read" in reason
123
+ assert "run-on lines" in reason
122
124
 
123
125
 
124
126
  def test_lint_line_numbers_survive_labeled_display_math():
@@ -744,7 +746,7 @@ def test_stray_line_break_in_an_unchanged_line_is_rejoined(tmp_path):
744
746
 
745
747
  assert path.read_text() == HEAD_PARAGRAPH
746
748
  assert numstat(path) == (0, 0)
747
- assert "put it back" in report["fixes"][0]["reason"]
749
+ assert "put those breaks back" in report["fixes"][0]["reason"]
748
750
 
749
751
 
750
752
  def test_one_moved_line_break_is_moved_back(tmp_path):
@@ -909,3 +911,49 @@ def test_qt_layout_notice_shows_head_now_and_suggested(tmp_path):
909
911
  assert head.startswith("git HEAD:")
910
912
  assert re.search(r"^ +3 This script determines .* amplitudes$", now, re.M)
911
913
  assert re.search(r"^ +4 spectral lines for", suggested, re.M)
914
+
915
+
916
+ def test_qt_fix_windows_create_their_own_application():
917
+ # cpb shows these windows without a QApplication; constructing the
918
+ # dialog first aborted the whole process
919
+ pytest.importorskip("PySide6")
920
+ script = (
921
+ "from PySide6.QtWidgets import QDialog\n"
922
+ "QDialog.exec = lambda self: 0\n"
923
+ "from pydifftools.continuous import (\n"
924
+ " show_markdown_fix_dialog, show_markdown_reload_dialog)\n"
925
+ "show_markdown_fix_dialog({'fixes': [{'line': 1, 'reason': 'r',\n"
926
+ " 'before': 'a ', 'after': 'a'}], 'warnings': []})\n"
927
+ "show_markdown_reload_dialog()\n"
928
+ "print('shown')\n"
929
+ )
930
+
931
+ completed = subprocess.run(
932
+ [sys.executable, "-c", script],
933
+ capture_output=True,
934
+ text=True,
935
+ env={**os.environ, "QT_QPA_PLATFORM": "offscreen"},
936
+ )
937
+
938
+ assert completed.returncode == 0, completed.stderr
939
+ assert completed.stdout.strip() == "shown"
940
+
941
+
942
+ def test_fix_reasons_cover_one_or_more_lines(tmp_path):
943
+ # one reason heads a whole page of fixes, so it never says "a line"
944
+ path = tmp_path / "source.md"
945
+ path.write_text(
946
+ "First sentence ends here. A second sentence begins.\n"
947
+ "This line is a run-on line that goes on well past the width.\n"
948
+ "It ends with a stray space. \n"
949
+ )
950
+
951
+ report = autofix_markdown_file(path, wrapnumber=55)
952
+
953
+ reasons = {fix["reason"] for fix in report["fixes"]}
954
+ assert len(reasons) == 3
955
+ assert all(reason.startswith("One or more ") for reason in reasons)
956
+ assert any(
957
+ "<b>always start sentences on new lines</b>" in reason
958
+ for reason in reasons
959
+ )
File without changes
File without changes
File without changes
File without changes