refactor: Minor code style improvements (Issue #166)#170
Merged
raifdmueller merged 1 commit intodevelopfrom Jan 24, 2026
Merged
refactor: Minor code style improvements (Issue #166)#170raifdmueller merged 1 commit intodevelopfrom
raifdmueller merged 1 commit intodevelopfrom
Conversation
1. ParseWarning.type as Enum - Add WarningType enum with UNCLOSED_BLOCK, UNCLOSED_TABLE - Update ParseWarning to use WarningType instead of str - Add Enum serialization to _convert_value() - Update CLI and MCP to use .value for JSON output 2. Remove redundant `pass` in Exception classes - FileReadError and FileWriteError already have docstrings 3. Move datetime imports to top of file - Remove duplicate imports inside metadata() function - Import UTC, datetime at module level 4. Extract _compute_hash() helper function - DRY: Single function for MD5 hash computation - Used in update() and insert() commands 5. Remove stale TODO and update code - SourceLocation now has end_line field - Use elem.source_location.end_line in API response All 435 tests passing, no behavior changes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rdmueller
added a commit
that referenced
this pull request
Jan 26, 2026
1. ParseWarning.type as Enum - Add WarningType enum with UNCLOSED_BLOCK, UNCLOSED_TABLE - Update ParseWarning to use WarningType instead of str - Add Enum serialization to _convert_value() - Update CLI and MCP to use .value for JSON output 2. Remove redundant `pass` in Exception classes - FileReadError and FileWriteError already have docstrings 3. Move datetime imports to top of file - Remove duplicate imports inside metadata() function - Import UTC, datetime at module level 4. Extract _compute_hash() helper function - DRY: Single function for MD5 hash computation - Used in update() and insert() commands 5. Remove stale TODO and update code - SourceLocation now has end_line field - Use elem.source_location.end_line in API response All 435 tests passing, no behavior changes. Co-authored-by: Ralf D. Müller <ralf.d.mueller@gmail.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This was referenced Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses all 5 code style improvements from Issue #166.
Changes
1. ParseWarning.type as Enum
WarningTypeenum withUNCLOSED_BLOCK,UNCLOSED_TABLEvaluesParseWarning.typefromstrtoWarningType_convert_value().valuefor JSON output2. Remove redundant
passin Exception classesFileReadErrorandFileWriteErroralready have docstringspassstatements3. Move datetime imports to top of file
from datetime import UTC, datetimeinside functionscli.py4. Extract
_compute_hash()helper functionupdate()andinsert()commands5. Remove stale TODO and update code
SourceLocationnow hasend_linefieldelem.source_location.end_line or elem.source_location.lineFiles Changed
models.pyasciidoc_parser.pycli.pymcp_app.pyfile_handler.pyapi/content.pyTest Plan
Closes #166
🤖 Generated with Claude Code