Skip to content

Fix ruff formatting in markitdown_mcp/server.py on main branch #21

@trsdn

Description

@trsdn

Problem Description

The file markitdown_mcp/server.py on the main branch has formatting issues that cause all PRs to fail the Code Quality checks.

Specific File

File: markitdown_mcp/server.py

Formatting Issues

The file has incorrect string concatenation formatting. Ruff wants to merge split strings that are unnecessarily separated:

# Current (incorrect):
"Base64 encoded file content " "(alternative to file_path)"

# Should be:
"Base64 encoded file content (alternative to file_path)"

Locations in File

  • Line ~779: "Base64 encoded file content " "(alternative to file_path)"
  • Line ~784: "Original filename when using " "file_content"
  • Line ~800: "Convert all supported files in a " "directory to Markdown"
  • Line ~810: "Path to the output directory " "(optional)"

Impact

  • All PRs fail Code Quality checks even if they don't touch this file
  • CI Gates fail as they depend on Code Quality checks
  • Confusing for contributors who get failures for code they didn't write

Fix Instructions

# On main branch
git checkout main
git pull origin main

# Apply ruff formatting to the specific file
ruff format markitdown_mcp/server.py

# Or format all files to be safe
ruff format .

# Commit the fix
git add markitdown_mcp/server.py
git commit -m "fix: apply ruff formatting to server.py

- Fix string concatenation formatting
- Merge unnecessarily split strings
- Resolves CI Code Quality failures"

git push origin main

Verification

After applying the fix:

# Should show no files need formatting
ruff format --check .

Root Cause

These formatting issues were likely introduced when the file was edited without running ruff format, possibly from:

  • Manual edits that split strings incorrectly
  • Merge conflicts that were resolved incorrectly
  • Copy-paste from unformatted source

Prevention

  1. Pre-commit hooks: Install ruff as a pre-commit hook
  2. Editor integration: Configure VSCode/PyCharm to format on save
  3. CI protection: Don't allow merging if formatting fails

Priority

Critical - This is blocking all PRs from passing CI checks.

Related Issues

Test PR

This was discovered in PR #16 (CI verification test) where even adding a simple markdown file triggers this formatting failure.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions