/julia-staticlint

Emacs integration for StaticLint.jl

Primary LanguageJuliaCreative Commons Zero v1.0 UniversalCC0-1.0

julia-staticlint

This simple package provides static code linting of Julia julia-mode language buffers through the StaticLint.jl backend. The static linting is done by a background process, which sends errors over a TCP connection to Flycheck for display in the Emacs buffer. The result looks like this:

This code was tested with the following setup:

  • OS: Ubuntu 20.04.1 LTS
  • Emacs: 27.1.9
  • Julia: 1.5.3
    • StaticLint: v7.0.0
    • SymbolServer: v6.0.1

In order to make this code run for your Emacs setup, include the following in your init.el (using use-package and quelpa):

(use-package julia-staticlint
  ;; https://github.com/dmalyuta/julia-staticlint
  ;; Emacs Flycheck support for StaticLint.jl
  :ensure nil
  :quelpa ((julia-staticlint :fetcher github
			       :repo "dmalyuta/julia-staticlint"
			       :files (:defaults "julia_staticlint_server.jl"
						 "julia_staticlint_client.jl")))
  :hook ((julia-mode . julia-staticlint-activate))
  :config
  (julia-staticlint-init))

Because this code uses a Julia backend, make sure that you can open a Julia REPL using the command julia in your terminal. You should also have the following packages installed in Julia: StaticLint, SymbolServer, Printf, and Sockets. Install by entering the following sequence into the Julia REPL:

julia> using Pkg
julia> Pkg.add(["SymbolServer","StaticLint","Printf","Sockets"])