-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Summary
The Format Check CI job is failing on the main branch. All actual tests pass, but the formatting check is broken.
Failed CI job: Format Check / Check Formatting
CI Run: https://github.com/SciML/BaseModelica.jl/actions/runs/20581996115/job/59111253685
What's broken
1. Files not formatted according to SciMLStyle
The following files need to be formatted with JuliaFormatter using SciMLStyle:
grammar/README.mdsrc/ast.jlsrc/evaluator.jlsrc/julia_parser.jlsrc/scratch.jltest/test_antlr_parser.jltest/test_error_messages.jltest/test_julia_parser.jl
2. Files with parsing errors (JuliaFormatter cannot process)
These files have malformed code blocks that cause JuliaFormatter to fail with parsing errors:
- README.md: Unterminated string literal at line 4:59 (likely a malformed code block)
- src/BaseModelica.jl: Unterminated string literal at line 5:44 (docstring contains unescaped backticks)
- src/antlr_parser.jl: Unterminated string literal at line 3:70 (docstring contains unescaped backticks)
Error messages from CI logs:
Warning: Failed to format file /home/runner/work/BaseModelica.jl/BaseModelica.jl/README.md due to a parsing error, skipping file
error =
ParseError:
# Error @ line 4:59
sys = parse_basemodelica("path/to/ExampleFirstOrder.bmo")
# └ ── unterminated string literal
Root Cause Analysis
The docstrings in src/BaseModelica.jl and src/antlr_parser.jl contain triple-backtick code blocks that confuse JuliaFormatter's parser. The README.md also has a duplicated \``juliaon line 47 (the markdown has```juliafollowed immediately by```julia` on the next line).
Suggested Fix Approach
- Fix the malformed code block in README.md (remove the duplicate
\``julia` line) - Format all the source and test files using JuliaFormatter:
using JuliaFormatter format("src/ast.jl", SciMLStyle()) format("src/evaluator.jl", SciMLStyle()) format("src/julia_parser.jl", SciMLStyle()) format("src/scratch.jl", SciMLStyle()) format("test/test_antlr_parser.jl", SciMLStyle()) format("test/test_error_messages.jl", SciMLStyle()) format("test/test_julia_parser.jl", SciMLStyle()) format("grammar/README.md", SciMLStyle())
- For the docstrings with code blocks, either escape the backticks or restructure the docstrings
Note
This issue was discovered during an automated CI health check. All actual tests pass - this is purely a formatting check issue.