4 ms·
Emacs and shellcheck
- warkdarrior 3y ago[flagged]
- infamouscow 3y agoGive it a try: https://www.gnu.org/software/emacs/ https://www.gnu.org/software/emacs/ Emacs will almost certainly outlive VS Code, and probably Microsoft.
- globular-toast 3y ago"I've survived your predecessors, and I will survive you!"
- infamouscow 3y agoEmacs has been used before most commenters on HN were born. They fail to understand or appreciate just how many hackers wrote custom editors with more or less an identical feature set as VS Code. Sometimes I feel like we're just repeating computer history from the 80s onward.
- uxp8u61q 3y agoFun fact: Microsoft is a year older than Emacs.
- deleted 3y ago[deleted]
- User23 3y agoThings like this are why I use Emacs. Wonderful hack thanks for sharing. Compare dead sibling’s recommendation[1] to the submission to understand what Emacs users mean when we talk about Emacs being easier to customize than the alternatives. VS Code is well and good for what it is, but it’s not a hacker’s editor. [1] https://github.com/vscode-shellcheck/vscode-shellcheck https://github.com/vscode-shellcheck/vscode-shellcheck
- bo-tato 3y agoAnd why I love doom emacs, it's almost like vscode in ease of getting set up for different languages. There's a init.el file with a :lang section where you can uncomment languages to enable them. Support for sh is enabled by default, and if shellcheck is installed it will use it without you having to customize anything. It's all the hackability of emacs when you want, but also just good defaults so everyone doesn't have to spend time configuring the same basic functionality.
- fiddlerwoaroof 3y agoI personally find that configuring vanilla emacs isn’t that scary. evil-mode + evil-collection provide most of the hard part of these distributions and I’ve found that growing from a minimal setup makes it easier to maintain your configuration than building on top of doom or spacemacs
- soraminazuki 3y agoDoom Emacs is minimal. You can configure it in pretty much the same way as vanilla Emacs without it getting in the way. I never felt my configuration was harder to maintain because of Doom. There are also modules you can enable that brings in a lot of packages, but they're purely optional. Personally, I find those modules to be sane and helpful. Also, adding evil mode won't address half of my requirements for a baseline Emacs experience. There are performance optimizations in Doom that I wouldn't otherwise have known to put in my own configuration. I'm grateful there are people who are taking care of such details for users like me. Normally, I avoid configuration frameworks. I don't use them in tmux, vim, or zsh. But Doom was the first configuration framework that I enjoyed using.
- fiddlerwoaroof 3y agoMy configuration is 3k lines of lisp code (measured by cloc). Doom is about 44k. So, Doom's configuration is about 12 times large than mine and my configuration works for just about everything I need. Adding support for a new language is typically mostly figuring out how to get a language server and configuring eglot for it, then installing syntax-highlighting either via tree-sitter or with (use-package <language>-mode :ensure t). Addtitionally, just skimming doom's early-init.el[1], it makes a lot of questionable choices (like requiring the use of `doom sync` for stuff emacs just does by itself). [1]: https://github.com/doomemacs/doomemacs/blob/master/early-init.el https://github.com/doomemacs/doomemacs/blob/master/early-ini...
- rascul 3y agoThere also exists a bash language server. The README.md has instructions for emacs and some others. https://github.com/bash-lsp/bash-language-server/ https://github.com/bash-lsp/bash-language-server/
- bitbang 3y agoThat language server automatically integrates shellcheck into its linter if shellcheck is present.
- js2 3y agoAdd shellcheck and shfmt to your pre-commit hooks. The easiest way to do so is with the shellcheck-py and shfmt-py wrappers: https://pypi.org/project/shellcheck-py/ https://pypi.org/project/shellcheck-py/ https://pypi.org/project/shfmt-py/ https://pypi.org/project/shfmt-py/
- c-hendricks 3y agoThe easiest way is probably winget install shellcheck shfmt brew install shellcheck shfmt
- js2 3y agoI'm referring to using these tools with https://pre-commit.com https://pre-commit.com. The wrappers work cross-platform and don't require folks interacting with the repo to install anything besides pre-commit itself and then running "pre-commit install" in the repo. The first time pre-commit is run, it then downloads and installs all of the hooks. The wrappers also work well with CI systems if you want to enforce the pre-commit hooks in PRs. Another advantage is that everyone interacting with the repo will be using the same versions of the tools. If you're not using these tools with pre-commit, then sure, install them directly via your package manager of choice.
- rbanffy 3y agoShellcheck made me a MUCH BETTER shell user. I was doing tons of small mistakes, bashisms, linuxisms, and other common avoidable mistakes.
- federicotdn 3y agoOh cool, I wrote the package the author links to. I believe the person that implemented the version built into Emacs used code similar to mine, so both packages should behave more or less the same (it's not a lot of code, in any case).
- amitp 3y agoThank you for that package! I was using that at first but then switched to the emacs 29 code.
- federicotdn 3y agoGlad it was useful !