mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
fix: Run process_markdown if a file is provided on the command line, otherwise run unittest
This commit is contained in:
parent
1ee481f4ea
commit
29a323c55d
1 changed files with 6 additions and 6 deletions
|
@ -9,7 +9,7 @@ import unittest
|
||||||
|
|
||||||
from aider.coders.base_coder import all_fences
|
from aider.coders.base_coder import all_fences
|
||||||
from aider.coders.editblock_coder import find_original_update_blocks
|
from aider.coders.editblock_coder import find_original_update_blocks
|
||||||
|
from aider.dump import dump # noqa: F401
|
||||||
|
|
||||||
def process_markdown(filename, fh):
|
def process_markdown(filename, fh):
|
||||||
try:
|
try:
|
||||||
|
@ -22,6 +22,8 @@ def process_markdown(filename, fh):
|
||||||
# Split the content into sections based on '####' headers
|
# Split the content into sections based on '####' headers
|
||||||
sections = re.split(r"(?=####\s)", content)
|
sections = re.split(r"(?=####\s)", content)
|
||||||
|
|
||||||
|
dump(sections)
|
||||||
|
|
||||||
for section in sections:
|
for section in sections:
|
||||||
if "editblock_coder.py" in section or "test_editblock.py" in section:
|
if "editblock_coder.py" in section or "test_editblock.py" in section:
|
||||||
continue
|
continue
|
||||||
|
@ -101,9 +103,7 @@ class TestFindOrBlocks(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) == 2:
|
||||||
print("Usage: python testsr.py <markdown_filename>")
|
|
||||||
else:
|
|
||||||
process_markdown(sys.argv[1], sys.stdout)
|
process_markdown(sys.argv[1], sys.stdout)
|
||||||
|
else:
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue