Skip to content

Fix typos and formatting in comments, docstrings, and markdown#2223

Open
chienyuanchang wants to merge 2 commits into
mainfrom
fix/typos-and-formatting
Open

Fix typos and formatting in comments, docstrings, and markdown#2223
chienyuanchang wants to merge 2 commits into
mainfrom
fix/typos-and-formatting

Conversation

@chienyuanchang

Copy link
Copy Markdown
Member

Cleanup pass fixing typos and formatting issues in comments, docstrings, and markdown files. No functional/API code was changed — only prose inside comments, docstrings, and Markdown, plus a few code-fence whitespace normalizations in READMEs.

Verified clean at the end with codespell 2.4.2 across the entire repo (excluding binary test fixtures, third-party notices, Microsoft boilerplate, and the vendored dwml code under converter_utils/docx/math/).

Fixes by file

Comments & docstrings

  • packages/markitdown/src/markitdown/_base_converter.py
    • steam_infostream_info
    • "This is primarily based `stream_info`" → "based on `stream_info`"
    • "used to in cases" → "used in cases"
    • "advances the position" → "advance the position"
    • "In these case" → "In these cases"
    • Duplicated "MUST be reset it MUST be reset" → "MUST be reset"
    • "charset, set)" → "charset, etc.)" (×2)
  • packages/markitdown/src/markitdown/_markitdown.py
    • # Add legaxy kwargs# Add legacy kwargs
    • """DEPRECATED: User register_converter instead."""Use register_converter
    • Second PRIORITY_SPECIFIC_FILE_FORMAT (== 10)PRIORITY_GENERIC_FILE_FORMAT (== 10) in register_converter docstring (was referencing the wrong constant)
    • "Plugins converters are already enabled.""Plugin converters are already enabled."
  • packages/markitdown/src/markitdown/__main__.py(e.g, UTF-8)(e.g., UTF-8) in --charset help
  • packages/markitdown/src/markitdown/_exceptions.py"Represents an a single attempt""Represents a single attempt"
  • packages/markitdown/src/markitdown/converters/_docx_converter.py, _epub_converter.py(e.g.m headings)(e.g., headings)
  • packages/markitdown/src/markitdown/converters/_epub_converter.py — stray closing """ inside a # comment removed
  • packages/markitdown/src/markitdown/converters/_outlook_msg_converter.py# Brue force# Brute force
  • packages/markitdown/src/markitdown/converters/_markdownify.pyJavascriptJavaScript in docstring
  • packages/markitdown/src/markitdown/converters/_bing_serp_converter.py — stray " after Base64URL removed
  • packages/markitdown/src/markitdown/converters/_doc_intel_converter.pyavailiableavailable in _analysis_features docstring
  • packages/markitdown-sample-plugin/src/markitdown_sample_plugin/_plugin.py
    • """Converts an RTF file to in the simplest possible way.""""""Converts an RTF file in the simplest possible way."""
    • # Read the file stream into an str using hte provided charsetinto a str using the provided charset

Test files

  • packages/markitdown-sample-plugin/tests/test_sample_plugin.pyTests the RTF converter dirctlydirectly
  • packages/markitdown/tests/test_cli_vectors.pyTest that the CLI readds from stdin correctlyreads
  • packages/markitdown/tests/test_module_misc.py# Make sure the targted attributetargeted (×2)

Markdown formatting

  • README.mdYoutube URLsYouTube URLs (consistent with YouTube video transcription elsewhere in the file)
  • packages/markitdown-mcp/README.md
    • Removed stray trailing TAB characters after two ```bash code-fence openers
    • Converted tab-indented JSON array elements in the Claude Desktop config example to 8-space indentation, matching the surrounding structure
  • packages/markitdown-sample-plugin/README.md
    • First Next, implement your custom DocumentConverter:First, implement... (there is no prior step for "Next" to follow from — the following two blocks correctly say "Next" and "Finally")
    • Normalized tab-indented lines inside the Python code samples to space indentation matching the surrounding 4/8-space code
    • Stripped a few trailing spaces

Deliberately not changed

  • SECURITY.md, SUPPORT.md, CODE_OF_CONDUCT.md — Microsoft boilerplate, left as-is
  • packages/markitdown/ThirdPartyNotices.md — contains a verbatim Apache-2.0 license copy, must not be modified
  • packages/markitdown/src/markitdown/converter_utils/docx/math/{latex_dict.py,omml.py} — vendored from dwml (Apache-2.0), kept verbatim per the notice
  • All test fixture files under test_files/ and ocr_test_data/ — expected outputs used for comparison

Verification

  • `get_errors` clean on all touched Python files
  • `codespell . --skip='...binaries/fixtures/legal...'` returns exit 0 across the whole repo

Comment/docstring typo fixes:
- _base_converter.py: fix 'steam_info' -> 'stream_info', missing 'on',
  duplicated 'MUST be reset', 'advances' -> 'advance',
  'used to in cases' -> 'used in cases', 'charset, set' -> 'charset, etc.'
- _markitdown.py: 'legaxy' -> 'legacy', 'User' -> 'Use' in DEPRECATED
  docstring, second 'PRIORITY_SPECIFIC_FILE_FORMAT (== 10)' ->
  'PRIORITY_GENERIC_FILE_FORMAT (== 10)', 'Plugins converters' ->
  'Plugin converters'
- __main__.py: 'e.g,' -> 'e.g.,' in --charset help
- _exceptions.py: 'an a single' -> 'a single'
- _docx_converter.py, _epub_converter.py: 'e.g.m headings' ->
  'e.g., headings'
- _epub_converter.py: remove stray closing triple-quote in comment
- _outlook_msg_converter.py: 'Brue force' -> 'Brute force'
- _markdownify.py: 'Javascript' -> 'JavaScript'
- _bing_serp_converter.py: remove stray '"' in Base64URL comment
- sample plugin _plugin.py: 'RTF file to in the simplest' ->
  'RTF file in the simplest'; 'into an str using hte' ->
  'into a str using the'

Markdown formatting fixes:
- README.md: 'Youtube URLs' -> 'YouTube URLs'
- markitdown-mcp/README.md: remove trailing tab characters after
  ```bash code fences; convert tab-indented JSON array elements to
  8-space indentation for consistency
- markitdown-sample-plugin/README.md: 'Next, implement' -> 'First,
  implement' for the initial step (no prior step exists); normalize
  tab-indented lines inside Python code samples to 4/8-space
  indentation; strip trailing spaces
Test files:
- test_sample_plugin.py: 'dirctly' -> 'directly'
- test_cli_vectors.py: 'readds' -> 'reads'
- test_module_misc.py: 'targted' -> 'targeted' (2 occurrences)

Source files:
- _doc_intel_converter.py: 'availiable' -> 'available' in docstring

Verified clean with:
  codespell --skip='.git,test_files,ThirdPartyNotices.md,SECURITY.md,\
    SUPPORT.md,CODE_OF_CONDUCT.md,latex_dict.py,omml.py,ocr_test_data,\
    *.pdf,*.docx,*.pptx,*.xlsx,*.xls,*.png,*.jpg,*.jpeg,*.wav,*.mp3,\
    *.mp4,*.zip,*.epub,*.msg,*.rtf' packages/ README.md

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a repo-wide prose cleanup focused on correcting typos and improving formatting in comments, docstrings, and Markdown documentation, without changing runtime behavior.

Changes:

  • Corrected numerous typos/grammar issues in Python comments and docstrings across core converters and utilities.
  • Normalized Markdown code-fence whitespace/indentation in package READMEs for cleaner rendering.
  • Fixed minor wording issues in tests’ docstrings/comments.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Fixes product-name capitalization in the supported-formats list (“YouTube”).
packages/markitdown/src/markitdown/_base_converter.py Clarifies/repairs accepts()/convert() docstring wording (stream_info, reset semantics, etc.).
packages/markitdown/src/markitdown/_markitdown.py Fixes typos and adjusts docstring wording around plugin enabling and converter priorities.
packages/markitdown/src/markitdown/_exceptions.py Fixes a grammatical error in a class docstring.
packages/markitdown/src/markitdown/main.py Fixes punctuation in CLI help text.
packages/markitdown/src/markitdown/converters/_bing_serp_converter.py Fixes a stray quote in a comment.
packages/markitdown/src/markitdown/converters/_doc_intel_converter.py Fixes typo in a helper docstring.
packages/markitdown/src/markitdown/converters/_docx_converter.py Fixes punctuation in a converter class docstring.
packages/markitdown/src/markitdown/converters/_epub_converter.py Fixes punctuation/typos in class docstring and a comment.
packages/markitdown/src/markitdown/converters/_markdownify.py Fixes capitalization in a method docstring.
packages/markitdown/src/markitdown/converters/_outlook_msg_converter.py Fixes typo in a comment.
packages/markitdown/tests/test_cli_vectors.py Fixes typo in a test docstring.
packages/markitdown/tests/test_module_misc.py Fixes typo in test comments.
packages/markitdown-mcp/README.md Normalizes code-fence whitespace and JSON indentation in examples.
packages/markitdown-sample-plugin/src/markitdown_sample_plugin/_plugin.py Fixes typos in docstring/comment text.
packages/markitdown-sample-plugin/tests/test_sample_plugin.py Fixes typo in a test docstring.
packages/markitdown-sample-plugin/README.md Improves step wording (“First…”) and normalizes indentation/trailing spaces in code samples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 673 to +676
Priorities work as follows: By default, most converters get priority
DocumentConverter.PRIORITY_SPECIFIC_FILE_FORMAT (== 0). The exception
is the PlainTextConverter, HtmlConverter, and ZipConverter, which get
priority PRIORITY_SPECIFIC_FILE_FORMAT (== 10), with lower values
priority PRIORITY_GENERIC_FILE_FORMAT (== 10), with lower values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants