Is there a ruff like linter

In the Python universe ruff handles code formatting and linting. Is there anything in Julia that I could call like Linter.lint(".")?

2 Likes

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.

1 Like

Runic.jl is written in Julia

3 Likes

Oops, I actually had Rust in mind because it’s so blazing fast :rofl:

4 Likes

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.

1 Like

I’ve come across GitHub - RelationalAI-oss/ReLint.jl: Linter for the Julia programming language but haven’t used it myself

4 Likes

Looks promising

Aqua.jl does some things that could be called linting.

1 Like

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?

1 Like

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!

2 Likes