Julia Coding Practices
Application skill for Julia BlueStyle learning (from the archived awesome-guidelines style capsules). When project sets SciMLStyle or custom .JuliaFormatter.toml, follow that formatter config first.
Core Principle
Julia package quality is formatter-enforced consistency + explicit module APIs, typed exported methods, qualified extensions, documented surface.
When to Use / NOT
- Julia packages, libraries, and
.jl application code (General/Grades).
- Setting up JuliaFormatter, Pkg.test, Documenter in CI.
NOT when:
- Generated Julia code, validate generators.
- One-off scripts with no package boundary, apply layout/docs lightly.
Workflow
- Layout, JuliaFormatter blue, 92 cols (
julia-style-formatting-layout.md).
- Modules, using, exports (
julia-style-modules-imports.md).
- Methods, return, kwargs, types (
julia-style-functions-methods.md).
- Docs/tests, docstrings, testset (
julia-style-docs-tests.md).
- Verify,
JuliaFormatter.format, Pkg.test(), docstring audit on exports.
Red Flags
- Tabs or trailing whitespace
using A, B combined import
- Bare
import extension without qualification
- Code outside module block in module files
- Undocumented exported functions
- Long functions without explicit
return
f(x, y=3) missing semicolon before kwargs
- Type baked into function name (
process_dataframe)
- Over-concrete public signatures (
Array{Int} vs AbstractArray)
- Mutable non-const globals
- Missing trailing comma in multiline literals
- Padded
f( x ) brackets
- Chained ternary operators
for i = 1:n instead of in
- Internal API without
_ prefix
@test x == 0.0 visual noise
- Caret-only Project.toml compat (
^0.17)
Verification
JuliaFormatter.format(".") with style = "blue"
julia --project -e 'using Pkg; Pkg.test()'
- Exported names have docstrings (manual or tool-assisted)
- Capsule checklist on main module exports
References
awesome-guidelines/references/julia-style-learning-note.md
awesome-guidelines/references/julia-style-formatting-layout.md
awesome-guidelines/references/julia-style-modules-imports.md
awesome-guidelines/references/julia-style-functions-methods.md
awesome-guidelines/references/julia-style-docs-tests.md
1---2name: julia-coding-practices3description: Use when authoring or reviewing Julia, BlueStyle/JuliaFormatter 4-space/92-col layout, explicit using/exports, typed methods with return, kwargs semicolon, docstrings, and formatter/test in CI.4---56# Julia Coding Practices78Application skill for Julia BlueStyle learning (from the archived `awesome-guidelines` style capsules). When project sets SciMLStyle or custom `.JuliaFormatter.toml`, follow that formatter config first.910## Core Principle1112Julia package quality is **formatter-enforced consistency + explicit module APIs**, typed exported methods, qualified extensions, documented surface.1314## When to Use / NOT1516- Julia packages, libraries, and `.jl` application code (General/Grades).17- Setting up JuliaFormatter, Pkg.test, Documenter in CI.1819**NOT when:**2021- Generated Julia code, validate generators.22- One-off scripts with no package boundary, apply layout/docs lightly.2324## Workflow25261. **Layout**, JuliaFormatter blue, 92 cols (`julia-style-formatting-layout.md`).272. **Modules**, using, exports (`julia-style-modules-imports.md`).283. **Methods**, return, kwargs, types (`julia-style-functions-methods.md`).294. **Docs/tests**, docstrings, testset (`julia-style-docs-tests.md`).305. **Verify**, `JuliaFormatter.format`, `Pkg.test()`, docstring audit on exports.3132## Red Flags3334- Tabs or trailing whitespace35- `using A, B` combined import36- Bare `import` extension without qualification37- Code outside module block in module files38- Undocumented exported functions39- Long functions without explicit `return`40- `f(x, y=3)` missing semicolon before kwargs41- Type baked into function name (`process_dataframe`)42- Over-concrete public signatures (`Array{Int}` vs `AbstractArray`)43- Mutable non-const globals44- Missing trailing comma in multiline literals45- Padded `f( x )` brackets46- Chained ternary operators47- `for i = 1:n` instead of `in`48- Internal API without `_` prefix49- `@test x == 0.0` visual noise50- Caret-only Project.toml compat (`^0.17`)5152## Verification5354- `JuliaFormatter.format(".")` with `style = "blue"`55- `julia --project -e 'using Pkg; Pkg.test()'`56- Exported names have docstrings (manual or tool-assisted)57- Capsule checklist on main module exports585960## References6162- `awesome-guidelines/references/julia-style-learning-note.md`63- `awesome-guidelines/references/julia-style-formatting-layout.md`64- `awesome-guidelines/references/julia-style-modules-imports.md`65- `awesome-guidelines/references/julia-style-functions-methods.md`66- `awesome-guidelines/references/julia-style-docs-tests.md`