Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link

Summary

  • Eliminated all implicit imports by using selective using Package: name1, name2 syntax
  • Added ExplicitImports.jl tests to CI to prevent regression
  • All tests pass

Changes Made

Source Files Updated

  • src/ModelOrderReduction.jl: Added explicit imports for DocStringExtensions, ModelingToolkit, LinearAlgebra, and Setfield symbols
  • src/utils.jl: Added explicit import for SparseArrays.sparse
  • src/precompile.jl: Added explicit imports for PrecompileTools macros

Test Infrastructure

  • test/explicit_imports.jl: New test file checking for implicit and stale imports
  • test/runtests.jl: Added ExplicitImports test suite
  • test/Project.toml: Added ExplicitImports as a test dependency

Before

Module ModelOrderReduction is relying on the following implicit imports:
* `DocStringExtensions` (and 3 exported names)
* `LinearAlgebra` (and 5 exported names)  
* `ModelingToolkit` (and 13 exported names)
* `PrecompileTools` (and 3 exported names)
* `Setfield` (and 2 exported names)
* `SparseArrays` (and 1 exported name)
Total: 31 implicit imports

After

Module ModelOrderReduction is not relying on any implicit imports.
✓ No implicit imports found!
✓ No stale explicit imports found!

Benefits

  • Prevents breakage: Explicit imports protect against breaking changes when dependencies modify their exports
  • Improves clarity: Makes it clear which symbols come from which packages
  • Catches issues early: ExplicitImports tests in CI will catch any future regressions
  • Follows best practices: Aligns with Julia community standards for package development

cc @ChrisRackauckas

🤖 Generated with Claude Code

- Replace `using Package` with selective `using Package: name1, name2` imports to eliminate all implicit imports
- Add ExplicitImports.jl tests to CI to ensure import hygiene is maintained
- Updated imports in:
  - src/ModelOrderReduction.jl: Added explicit imports for DocStringExtensions, ModelingToolkit, LinearAlgebra, and Setfield
  - src/utils.jl: Added explicit import for SparseArrays.sparse
  - src/precompile.jl: Added explicit imports for PrecompileTools macros
- Added test/explicit_imports.jl with tests for no implicit or stale imports
- Added ExplicitImports to test dependencies in test/Project.toml

All tests pass. The package now follows best practices for explicit imports, reducing the risk of breakage from transitive dependency changes.

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

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

1 similar comment
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ChrisRackauckas ChrisRackauckas merged commit a5f1d3a into SciML:main Jan 3, 2026
5 of 7 checks passed
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.

3 participants