syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.89k forks source link

flycheck mode is not enabled with shell-scripts layer #8612

Closed alistair closed 7 years ago

alistair commented 7 years ago

Description :octocat:

flycheck mode is not enabled with shell-scripts layer

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: No flycheck warning or errors display running the following does cause flycheck to work

:flycheck-mode
:flycheck-select-checker
shellcheck << and select it >>

Expected behaviour: :heart: :smile: Flycheck warnings or errors display

System Info :computer:

CeleritasCelery commented 7 years ago

Works for me

alistair commented 7 years ago

running :flycheck-verify-setup results in

Syntax checkers for buffer run-docker-app.sh in sh-mode:

There are no syntax checkers for this buffer!

The following syntax checkers are not registered:

  - ada-gnat
  - asciidoc
  - asciidoctor
  - c/c++-clang
  - c/c++-cppcheck
  - c/c++-gcc
  - cfengine
  - chef-foodcritic
  - coffee
  - coffee-coffeelint
  - coq
  - css-csslint
  - css-stylelint
  - d-dmd
  - dockerfile-hadolint
  - elixir-dogma
  - emacs-lisp
  - emacs-lisp-checkdoc
  - erlang
  - eruby-erubis
  - fortran-gfortran
  - go-build
  - go-errcheck
  - go-gofmt
  - go-golint
  - go-test
  - go-unconvert
  - go-vet
  - groovy
  - haml
  - handlebars
  - haskell-ghc
  - haskell-hlint
  - haskell-stack-ghc
  - html-tidy
  - javascript-jscs
  - javascript-jshint
  - javascript-standard
  - json-jsonlint
  - json-python-json
  - less
  - less-stylelint
  - lua
  - lua-luacheck
  - markdown-mdl
  - perl
  - perl-perlcritic
  - php
  - php-phpcs
  - php-phpmd
  - processing
  - protobuf-protoc
  - pug
  - puppet-lint
  - puppet-parser
  - python-flake8
  - python-pycompile
  - python-pylint
  - r-lintr
  - racket
  - rpm-rpmlint
  - rst
  - rst-sphinx
  - ruby
  - ruby-jruby
  - ruby-rubocop
  - ruby-rubylint
  - rust
  - rust-cargo
  - sass
  - sass/scss-sass-lint
  - scala
  - scala-scalastyle
  - scheme-chicken
  - scss
  - scss-lint
  - scss-stylelint
  - sh-bash
  - sh-posix-bash
  - sh-posix-dash
  - sh-shellcheck
  - sh-zsh
  - slim
  - slim-lint
  - sql-sqlint
  - systemd-analyze
  - tex-chktex
  - tex-lacheck
  - texinfo
  - typescript-tslint
  - verilog-verilator
  - xml-xmllint
  - xml-xmlstarlet
  - yaml-jsyaml
  - yaml-ruby

Try adding these syntax checkers to `flycheck-checkers'. Flycheck Mode is
disabled. Use SPC u M-x flycheck-disable-checker to enable disabled checkers.

--------------------

Flycheck version: 31snapshot (package: 20170324.340)
Emacs version:    24.5.1
System:           x86_64-pc-linux-gnu
Window system:    x
alistair commented 7 years ago

@CeleritasCelery might be interesting if you gave some context as to your setup so that we could compare why it works for you and not me. I actually raised this as it wasnt working for a mate which I was able to reproduce.

CeleritasCelery commented 7 years ago

I have no setup for shellcheck. It literally worked out of the box because it was on my path. Does your file have a she-bang and is it one of the supported shells? I know shellcheck won't work when I try to use it with tcsh.

CeleritasCelery commented 7 years ago

Though I have not updated my packages in a while, so something might be broken.

delaanthonio commented 7 years ago

@alistair it looks like you don't have the shell-scripts layer enabled in your .spacemacs.

d12frosted commented 7 years ago

@beta1440 hawks's eye!

maticko commented 7 years ago

I have shell-scripts enabled in my .spacemacs config but I still don't get flycheck working. My config: https://github.com/maticko/dotfiles/blob/master/.spacemacs

CeleritasCelery commented 7 years ago

what language are you trying to check?

maticko commented 7 years ago

Bash

CeleritasCelery commented 7 years ago

Do you have shellcheck installed?

maticko commented 7 years ago

I do ~ which shellcheck /usr/local/bin/shellcheck. If I manually select SPC e s sh-shellcheck, it's working. But it's not picked automatically.

CeleritasCelery commented 7 years ago

What is your files shebang?

maticko commented 7 years ago

standard #!/bin/bash and #!/usr/bin/env bash

CeleritasCelery commented 7 years ago

do you see [bash] in your modeline? and does it work if you call sh-set-shell?

maticko commented 7 years ago

screen shot 2017-08-31 at 10 39 55 am

No change if I call sh-set-shell

CeleritasCelery commented 7 years ago

Probably should open a new issue then. Or ask this over at flycheck.

UtaAmb commented 4 years ago

@maticko did you ever resolve this issue, i'm having the same problem?

maticko commented 4 years ago

@AntonOrlovAmbulnz never worked for me.

c02y commented 3 years ago

@UtaAmb @maticko lsp problem? https://github.com/syl20bnr/spacemacs/issues/14719