Skip to content

Fix function call line split following Catalyst.jl PR #1306 #1090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2025

Conversation

ChrisRackauckas
Copy link
Member

Summary

Fix unnecessary line split in Julia code following the guidelines established in Catalyst.jl PR #1306. This PR improves code readability by consolidating a short expression that was unnecessarily split across multiple lines.

Background

These formatting issues are being addressed upstream in JuliaFormatter.jl PR #934, which implements algorithmic fixes to prevent these unnecessary line splits. However, since that PR is not yet merged, manual fixes are needed in the meantime to improve code readability.

Changes Made

Fixed 1 instance of problematic line split:

  • src/debug.jl: Function call split across 4 lines consolidated to 1 line

Example Fix

Before:

if e isa DomainError &&
   occursin(
    "will only return a complex result if called with a complex argument. Try ",
    e.msg)

After:

if e isa DomainError && occursin("will only return a complex result if called with a complex argument. Try ", e.msg)

Rationale

Following Catalyst.jl PR #1306's approach:

  • Prioritize readability over strict formatter rules for short expressions
  • Keep semantically related code units together
  • Line reduced to 123 characters (well under reasonable limits)

Note

This is part of a systematic effort to apply the same formatting improvements across 10+ SciML repositories.

🤖 Generated with Claude Code

Fix unnecessarily split function call in DomainError hint registration.
Line length reduced to 123 characters, improving readability.

Following Catalyst.jl PR #1306 guidelines.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
occursin(
"will only return a complex result if called with a complex argument. Try ",
e.msg)
if e isa DomainError && occursin("will only return a complex result if called with a complex argument. Try ", e.msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
if e isa DomainError && occursin("will only return a complex result if called with a complex argument. Try ", e.msg)
if e isa DomainError &&
occursin("will only return a complex result if called with a complex argument. Try ", e.msg)

@ChrisRackauckas ChrisRackauckas merged commit 5edf434 into master Aug 2, 2025
57 of 64 checks passed
@ChrisRackauckas ChrisRackauckas deleted the fix-formatter-line-splits branch August 2, 2025 22:32
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