Enforce MOD3/MOD4: `using`, never `import`
メンテナーはふだん 1 日以内に返信
@ocots がすでに取り組んでいます。
2026年7月30日 から。
評価
この issue はまだ評価されていません。
説明
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
- 主要言語
- Julia
- スター
- 135
- フォーク
- 11
- 平均マージ
- 7時間 49分
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
control-toolbox/OptimalControl.jl のほかの issue
-
[Doc] A pull request without the preview label announces a deployment that never happens対応中かも @ocots が今日担当しました。 オープンdocumentation
control-toolbox/OptimalControl.jl#1042 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Doc] User guide to the duals: every kind, constraint ↔ dual, direct ↔ indirect対応中かも @ocots が 7 日前に担当しました。 オープン
control-toolbox/OptimalControl.jl#1035 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Tests of the duals: every kind of constraint, direct vs indirect, pinned algorithms対応中かも @ocots が 7 日前に担当しました。 オープン
control-toolbox/OptimalControl.jl#1034 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Doc] Examples for the sign convention of duals and costate (min/max, writing of constraints, direct vs indirect)対応中かも @ocots が 15 日前に担当しました。 オープン
control-toolbox/OptimalControl.jl#1016 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Documentation: sign conventions (min/max, p⁰, constraints, duals) and how they appear in a solution対応中かも @ocots が 18 日前に担当しました。 オープンdocumentation
control-toolbox/OptimalControl.jl#1015 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
control-toolbox/OptimalControl.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
lux
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100