Hacker GitHub

← All repos

mvdan/sh

View on GitHub ↗ ★ 9,172 Go

A shell parser, formatter, and interpreter with bash and zsh support; includes shfmt

30 mentions on Hacker News by 20 people: 12 stories, 18 comments · first 2016-06-04 · latest 2025-04-09

Mentions per year 30 mentions · busiest year 2016 (8)
20082026
  1. …only backslashes. If you use `&&` -- you have disambiguated the two cases so I can format it. [1] https://github.com/mvdan/sh
    comment by spicypete · 2025-04-09 · in Dockerfmt: A Dockerfile Formatter
  2. …inconsistencies can be autofixed with shfmt. I've been using it for years and it's been solid. https://github.com/mvdan/sh
    comment by 5e92cb50239222b · 2024-05-22 · in Amber: Programming language compiled to Bash
  3. Are you assuming that based on visiting the vanity import path in a browser? https://github.com/mvdan/sh is the repo looks like v3.8.0 was released 2 weeks ago.
    comment by moondev · 2024-02-24 · in Go run
  4. …run this on my scripts before using them. Then shfmt for nice, reliable autoformatting: https://github.com/mvdan/sh And finally, checkbashisms if you intend on making pure posix scripts that are compatible with debian/ubuntu's dash. It is…
    comment by ftaghn · 2023-08-09 · in Pure Bash Bible (2018)
  5. https://github.com/mvdan/sh/blob/master/syntax/canonical.sh is one small example.
    comment by mvdan · 2023-02-11 · in Shfmt – format shell programs
  6. …properly would be quite a bit of work, and such ambiguous syntax isn't particularly common. See https://github.com/mvdan/sh/issues/686 for my current thoughts on how to tackle it. The third caveat concerns parsing `export` and `let` as…
    comment by mvdan · 2023-02-11 · in Shfmt – format shell programs
  7. …(9 comments) shmfmt - A shell parser, formatter, and interpreter with BASH support https://github.com/mvdan/sh (Submitted often but not yet discussed) --- /me whispers: Hint: You could be that guy [1] (or gal, they, it, etc): /submit shmfmt
    comment by metadat · 2023-02-11 · in Gofumpt: A stricter gofmt
  8. …not found an optimal way to do it yet. [shellcheck] https://github.com/koalaman/shellcheck [shfmt] https://github.com/mvdan/sh [sub] https://github.com/qrush/sub [bashdb] http://bashdb.sourceforge.net/ [vscode-bash-debug]…
  9. …example: https://github.com/u-root/u-root/tree/master/cmds/core EDIT: You may also be interested in https://github.com/mvdan/sh
  10. The shfmt parser seems re-usable: https://github.com/mvdan/sh (syntax subpackage).
    comment by arp242 · 2021-10-20 · in s/bash/zsh/g
  11. …for ShellCheck compliance: https://github.com/anordal/shellharden/ shfmt is gofmt for shell: https://github.com/mvdan/sh ShellScriptFormatter is another formatter: https://github.com/osalvador/ShellScriptFormatter Some of these tools and…
  12. …This is built on tree-sitter, but there are a couple of other interesting shell parser projects: * https://github.com/mvdan/sh * https://github.com/koalaman/shellcheck At Fig ( https://withfig.com ), we had to write a bash parser from…
    comment by brendanfalk · 2021-04-01 · in Bash-LSP: A language server for Bash
  13. …for ShellCheck compliance: https://github.com/anordal/shellharden/ shfmt is gofmt for shell: https://github.com/mvdan/sh ShellScriptFormatter is another formatter: https://github.com/osalvador/ShellScriptFormatter Some of these tools and…
  14. To use in combination with shfmt : https://github.com/mvdan/sh
  15. …is one of my favorite tips for almost effortlessly improving devops productivity (along with using https://github.com/mvdan/sh for auto-formatting) — by now shellcheck has good editor support in e.g. VSCode and I have a standard…
  16. I would also add shfmt, to format scripts: https://github.com/mvdan/sh
    comment by hivacruz · 2020-10-10 · in Bash Error Handling
  17. …both ShellCheck and shfmt had really helped me to save time and write safer, readable scripts. https://github.com/mvdan/sh
    comment by sirtoffski · 2020-02-02 · in Writing Safe Shell Scripts (2019)
  18. is https://github.com/mvdan/sh relevant ?
    comment by pyed · 2016-06-04 · in Shell Style Guide from Google