Pemsamentu sira husi Amit: Emacs no shellcheck

Photo of author

By naroman

Julia Evans nia aprezentasaun diak liu ne’ebé naran Hamosu Oin Mak Fasil. Uma husi informasaun ida ba hau maka hau tenki uza ferramenta ba parte sira iha sistema ne’ebé hau hakarak atu hatene di’ak. Tanba ne’e, wainhira hau mosu bash script hau tenki uza shellcheck.

Resulta katak, Emacs 29 iha suporta ba shellcheck, no versaun sira liu husi Emacs bele uza pajina flymake-shellcheck.

Atu halo setup iha Emacs 29:

(use-package flymake
  :bind ((\"H-e\" . flymake-show-project-diagnostics))

(use-package sh-script
  :hook (sh-mode . flymake-mode))

Hau uza consult atu hare erro sira, no hau hakarak atu halo erro sira sai hanesan informasaun iha mode line, entaun konfigurasaun flymake hau nian maka:

(use-package flymake
  :bind ((\"H-e\" . my/consult-flymake-project))
  :preface
  (defun my/consult-flymake-project ()
    (interactive)
    (consult-flymake t))
  :custom
  (flymake-suppress-zero-counters t)
  :config
  (defface my/flymake-modeline-error-echo
    \'((t :inherit \'flymake-error-echo :background \"red\"))
    \"Mode line flymake errors\")
  (put \'flymake-error \'mode-line-face \'my/flymake-modeline-error-echo)
  (defface my/flymake-modeline-warning-echo
    \'((t :inherit \'flymake-warning-echo :background \"orange\"))
    \"Mode line flymake warnings\")
  (put \'flymake-warning \'mode-line-face \'my/flymake-modeline-warning-echo))

Too sedu atu hatene saida seluk mak hau hakarak, maibé hanesan ohin mak atu hau hatene katak iha erro barak iha hau nia script shell.

Label:
emacs

Amit
– Sesta, Outubru 06, 2023

Tetun Translator

FREE
VIEW