Skip to content

[CI Broken] Format Check failing due to unformatted files and malformed code blocks #69

@ChrisRackauckas-Claude

Description

@ChrisRackauckas-Claude

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.md
  • src/ast.jl
  • src/evaluator.jl
  • src/julia_parser.jl
  • src/scratch.jl
  • test/test_antlr_parser.jl
  • test/test_error_messages.jl
  • test/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

  1. Fix the malformed code block in README.md (remove the duplicate \``julia` line)
  2. 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())
  3. 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.

cc @ChrisRackauckas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions