In the Python universe ruff handles code formatting and linting. Is there anything in Julia that I could call like Linter.lint(".")
?
For formatting, you can check out Runic.jl, which is actually written in Rust Julia, or JuliaFormatter.jl. The linting story is less satisfying, the closest we have at the moment is JET.jl.
Runic.jl is written in Julia
Oops, I actually had Rust in mind because it’s so blazing fast
JET.jl is no linter, or maybe just a very small part of it. There are no rules like unused variables or so.
In principle there would be the linter that is in the VSCode extension. I don’t know how good that one is, it certainly has no convenient entry point.
I’ve come across GitHub - RelationalAI-oss/ReLint.jl: Linter for the Julia programming language but haven’t used it myself
Looks promising
Aqua.jl does some things that could be called linting.
In case you’re not aware, the Julia VS Code extension does have a linter. I’m not sure if it’s enabled by default. To enable it, make sure that julia.lint.run
is set to true. I also recommend turning on the linting for missing references, which is the most common kind of linting error that you will see.
Just out of curiosity, is it possible to run the VS Code linter from the command-line, e.g. in CI?
Since it uses StaticLint.jl, I guess not Docs? · Issue #14 · julia-vscode/StaticLint.jl · GitHub
Came across this helpful collection Automate Your Code Quality In Julia
While we’re at it: Sharing your code
There is an upcoming JuliaCon talk about ReLint by the way!