Enforce MOD3/MOD4: `using`, never `import`
Los mantenedores suelen responder en 1 día
@ocots ya está trabajando en esto.
Desde el 30/7/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Context
ct-conventions mandates, in MOD3 (no import) and MOD4 (qualified external imports):
Everything is qualified — with
using, neverimport. Bring modules into scope, not their symbols (using Pkg: Pkg,using Pkg: Sub); callModule.symboleverywhere and extend methods qualified (Base.show(...)).
Two distinct violations to fix here:
importanywhere — replace withusing.- The dotted submodule form
using Pkg.Sub— it silently pullsSub's exported names into scope too (unlikeusing Pkg: Sub), whichMOD4explicitly forbids.
Translation table (from MOD3):
| Instead of | Write |
|---|---|
import Pkg |
using Pkg: Pkg |
import Pkg.Sub |
using Pkg: Sub |
import Pkg.Sub: Sub |
using Pkg: Sub |
import Pkg: sym1, sym2 |
using Pkg: sym1, sym2 |
using Pkg.Sub (forbidden) |
using Pkg: Sub |
Scope — doc, code, and tests
- Code —
src/,ext/, and any# Exampledocstring blocks. - Docs —
docs/src/*.md(@example/@setupblocks) and any other.mdshowing Julia code (README,BREAKING.md/CHANGELOG.mdmigration snippets). - Tests — everything under
test/, plus a regression-guard test (see below) so this can't silently regress again.
⚠️ Exception: a migration doc that quotes a past API verbatim in a "Before" snippet should be left as-is — that's a historical fact, not a style violation. Only fix "After"/current-usage examples.
Finding offending lines
# `import` statements, anywhere in Julia code or Markdown docs
rg --fixed-strings 'import ' -g '*.jl' -g '*.md' .
# forbidden dotted `using Pkg.Sub` form
rg -n 'using [A-Za-z][A-Za-z0-9]*\.[A-Za-z]' -g '*.jl' -g '*.md' .
Current count in this repo (rough — includes some CHANGELOG/BREAKING prose mentions that don't need changing; review each hit):
import: ~87- dotted
using Pkg.Sub: ~3
Regression guard
CTLie already completed this migration (control-toolbox/CTLie.jl#24) and added a meta-test that scans every tracked .jl/.md file for both patterns:
test/suite/meta/test_no_import.jl
It's self-contained and auto-discovered by the standard CTBase.run_tests runner (suite/*/test_* glob) — copy/adapt it directly, and extend the DOTTED_USING_EXEMPT list for any files here with legitimate historical "Before" snippets.
Note on sibling submodule imports
If this repo has a submodule manifest structure (src/<Name>/<Name>.jl), relative sibling imports like using ..Lower or using ..Core: AbstractTag are fine as-is and not part of this rule. Only the absolute dotted form (using Pkg.Sub, with a real package name, not ..) is forbidden.
🤖 Filed with Claude Code
- Lenguaje dominante
- Julia
- Estrellas
- 135
- Forks
- 11
- Merge medio
- 7 h 51 min
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de control-toolbox/OptimalControl.jl
-
[Doc] User guide to the duals: every kind, constraint ↔ dual, direct ↔ indirectPosiblemente ocupada @ocots la tomó hace 5 días. Abierto
control-toolbox/OptimalControl.jl#1035 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Tests of the duals: every kind of constraint, direct vs indirect, pinned algorithmsPosiblemente ocupada @ocots la tomó hace 5 días. Abierto
control-toolbox/OptimalControl.jl#1034 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Doc] Examples for the sign convention of duals and costate (min/max, writing of constraints, direct vs indirect)Posiblemente ocupada @ocots la tomó hace 13 días. Abierto
control-toolbox/OptimalControl.jl#1016 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Documentation: sign conventions (min/max, p⁰, constraints, duals) and how they appear in a solutionPosiblemente ocupada @ocots la tomó hace 16 días. Abiertodocumentation
control-toolbox/OptimalControl.jl#1015 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Tests fail on Julia 1.13: keyword-only anonymous function in test/problems/goddard.jlPosiblemente ocupada @ocots la tomó hace 17 días. Abierto
control-toolbox/OptimalControl.jl#996 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de control-toolbox/OptimalControl.jl
Issues similares
-
backport 1.14 GC
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
JuliaDiff/TaylorSeries.jl#445 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
control-toolbox/CTActions#139 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
SciML/Optimization.jl#1448 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
SciML/PETScDiffEq.jl#362 ·
Los mantenedores suelen responder en 1 día