shell脚本格式化

shell脚本格式化

1. Intellij-idea插件格式化

(1.) 打开file> settings > plugins, 搜索BashSupport, 安装重启Idea

(2.) 按ctrl + alt + L键进行格式化

2. vscode插件格式化

(1.)插件搜索 格式化:shell-format

(2.)下载 https://github.com/mvdan/sh/releases

(3.)vscode配置

​ 文件->首选项->设置

"shellformat.path": "E:/xxx/shfmt_v2.6.3_windows_amd64.exe"

(4.) 右键->format document 进行格式化

(5.) 其他插件

​ 语法提示:shellman 语法检查:shellcheck

3. 在线格式化

https://tool.lu/shell/
http://web.chacuo.net/formatsh

参考链接

https://blog.csdn.net/weixin_42626643/article/details/93178029

https://www.cnblogs.com/testopsfeng/p/13190839.html#:~:text=shellcheck可通过(鼠标右键 -> 格式化文档),或者通过快捷键:Ctrl,%2B Alt %2B L格式化代码

【励志篇】: 古之成大事掌大学问者,不惟有超世之才,亦必有坚韧不拔之志。
原文地址:https://www.cnblogs.com/tomtellyou/p/15778731.html