What Are the Best Linting and Formatting Tools for Bash in Neovim?

0
0
Asked By Uniqu3User2023 On

I'm currently setting up Neovim and want to know about useful tools for linting and formatting Bash scripts. So far, I've only gotten bashls and Neovim diagnostics that use shellcheck working. I'm hoping to find a way for the diagnostics to display code warnings like "SCXXXX" as virtual text to avoid searching for them manually.

I've heard about tools like beautysh and prettier, but I'm curious if they're as developed as similar tools in other programming languages. Since my experience is limited to Bash, I wonder if these tools are as beneficial for shell scripting or if the nature of scripting makes them less useful. Any suggestions for tools, no matter how small, would be greatly appreciated, especially as I'm new to this and have only used a basic Neovim setup without the industry-standard editors like VS Code.

3 Answers

Answered By BashLover99 On

Definitely check out ShellCheck! It works great with bashls and can help you catch a lot of errors. It's super useful, especially if you're running scripts that will go into CI/CD pipelines. It'll make your life much easier!

NeovimNinja -

Totally agree! ShellCheck is essential if you're doing anything serious with bash.

Answered By ScriptScribe On

When it comes to one-off scripts, I mostly rely on syntax highlighting in my editor. If it's a bigger project or something that’s critical, I really advise using shellcheck to lint your scripts. It saves a ton of hassle later!

BashBuddy -

I've learned that the hard way! Using shellcheck up front really helps avoid those late-night debugging sessions.

Answered By CodeFormatterFan On

For formatting, you should look at shfmt from mvdan. It's a solid formatter specifically for shell scripts and works great with shellcheck. Combined, they can really streamline your workflow!

Related Questions

Convert Json To Xml

Bitrate Converter

GUID Generator

GUID Validator

Convert Json To C# Class

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.