Skip to content

Conversation

@ChrisRackauckas
Copy link
Member

Summary

  • Applied JuliaFormatter to ensure consistent code formatting
  • Formatted 10 files to comply with SciML style guide

Changes

 docs/pages.jl                |  2 +-
 src/DelayDiffEq.jl           | 18 ++++++++++++------
 src/discontinuity_type.jl    |  6 ++++--
 src/fpsolve/fpsolve.jl       |  5 ++++-
 src/fpsolve/functional.jl    |  3 ++-
 src/integrators/interface.jl |  7 ++++---
 src/integrators/utils.jl     |  9 ++++++---
 src/solve.jl                 | 18 ++++++++++++------
 src/utils.jl                 |  3 ++-
 test/qa/qa_tests.jl          |  4 ++--
 10 files changed, 49 insertions(+), 26 deletions(-)

This PR was automatically generated by OrgMaintenanceScripts.jl

- Applied JuliaFormatter with SciML style guide
- Formatted 10 files

🤖 Generated by OrgMaintenanceScripts.jl
@ChrisRackauckas
Copy link
Member Author

@ChrisRackauckas ChrisRackauckas deleted the fix-formatting branch July 29, 2025 04:57
ChrisRackauckas pushed a commit to ChrisRackauckas/JuliaFormatter.jl that referenced this pull request Jul 29, 2025
Added extensive regression tests based on actual formatting issues found
in SciML repositories that were broken by JuliaFormatter v2. These tests
ensure that the most common problematic patterns don't reoccur.

Test coverage includes:
- DiffEqGPU.jl array indexing issues (II[i, j, 1] patterns)
- @unpack macro formatting from multiple repos
- Function call assignment breaking
- Complex constructor calls and nested expressions
- Mathematical expressions with array indexing
- Type parameter formatting
- Closure definitions and macro calls
- Array slicing operations
- Multiple assignment patterns
- Nested array access patterns

Tests are based on real examples from:
- SciML/DiffEqGPU.jl#356
- SciML/DelayDiffEq.jl#318
- SciML/BoundaryValueDiffEq.jl#354
- SciML/MultiScaleArrays.jl#99
- And many other SciML repositories

These tests will prevent future regressions and ensure SciMLStyle
continues to work well for scientific computing code.

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

Co-Authored-By: Claude <[email protected]>
domluna pushed a commit to domluna/JuliaFormatter.jl that referenced this pull request Jul 30, 2025
)

* Fix excessive line breaking in SciMLStyle for readable expressions

Addresses the formatting regression introduced in JuliaFormatter v2 where
commonly-used expressions were being broken across multiple lines, reducing
code readability.

Fixes several expression types:
- Array indexing: II[i, j, 1] no longer broken across lines
- Macro calls: @unpack statements keep reasonable line breaks
- Function calls: Avoid awkward breaks in function calls
- Type parameters: Keep Type{A, B, C} compact
- Vector literals: Short vectors stay on one line when possible

The fix is implemented by making find_optimal_nest_placeholders() more
conservative for specific expression types that benefit from staying compact.
Each type gets appropriate thresholds for placeholder count and margin tolerance.

Fixes: https://github.com/SciML/DiffEqGPU.jl/pull/356/files

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

Co-Authored-By: Claude <[email protected]>

* Fix test failures by refining conservative line breaking logic

Fixed two failing SciML tests by making the Curly type line breaking logic
more sensitive to margin constraints. The previous fix was too aggressive
and prevented necessary line breaks in Union types when margins were
extremely tight (margin=1).

Changes:
- Added margin-based logic for Curly types to allow line breaks when needed
- Maintained aggressive protection for RefN (array indexing) to prevent
  the original issue
- All tests now pass including the comprehensive fix tests

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

Co-Authored-By: Claude <[email protected]>

* Enhance conservative line breaking for macro calls

Made MacroCall protection more aggressive to better handle complex macro
expressions like @time/@sync chains. While this doesn't fully solve all
macro assignment breaking issues, it improves protection for most cases.

Changes:
- Increased MacroCall placeholder limit from 6 to 10
- Increased MacroCall margin tolerance from +30 to +60
- Better protection for complex macro expressions

Note: Some very long macro assignments may still break due to deeper
formatting logic that needs additional investigation.

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

Co-Authored-By: Claude <[email protected]>

* Add comprehensive SciML regression tests from real repositories

Added extensive regression tests based on actual formatting issues found
in SciML repositories that were broken by JuliaFormatter v2. These tests
ensure that the most common problematic patterns don't reoccur.

Test coverage includes:
- DiffEqGPU.jl array indexing issues (II[i, j, 1] patterns)
- @unpack macro formatting from multiple repos
- Function call assignment breaking
- Complex constructor calls and nested expressions
- Mathematical expressions with array indexing
- Type parameter formatting
- Closure definitions and macro calls
- Array slicing operations
- Multiple assignment patterns
- Nested array access patterns

Tests are based on real examples from:
- SciML/DiffEqGPU.jl#356
- SciML/DelayDiffEq.jl#318
- SciML/BoundaryValueDiffEq.jl#354
- SciML/MultiScaleArrays.jl#99
- And many other SciML repositories

These tests will prevent future regressions and ensure SciMLStyle
continues to work well for scientific computing code.

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

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
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.

1 participant