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. ▲ 93
    Show HN: Hucksh – A shell with a very good memory
    story by LarryClapp · 2023-12-21 · 66 comments
  5. …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)
  6. 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
  7. …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
  8. ▲ 115
    Shfmt – format shell programs
    story by typical182 · 2023-02-11 · 23 comments
  9. …(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
  10. …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]…
  11. ▲ 59
    Ask HN: Let's build Checkstyle for Bash?
    story by a-t-0 · 2022-02-20 · 69 comments
  12. …example: https://github.com/u-root/u-root/tree/master/cmds/core EDIT: You may also be interested in https://github.com/mvdan/sh
  13. The shfmt parser seems re-usable: https://github.com/mvdan/sh (syntax subpackage).
    comment by arp242 · 2021-10-20 · in s/bash/zsh/g
  14. …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…
  15. …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
  16. …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…
  17. To use in combination with shfmt : https://github.com/mvdan/sh
  18. …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…
  19. ▲ 1
    Shfmt v3.2 Released
    story by todsacerdoti · 2020-10-31 · 0 comments
  20. I would also add shfmt, to format scripts: https://github.com/mvdan/sh
    comment by hivacruz · 2020-10-10 · in Bash Error Handling
  21. …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)
  22. ▲ 1
    Mvdan/Sh: Posix Shell in Go
    story by svnpenn · 2019-12-30 · 0 comments
  23. ▲ 3
    shfmt 1.0 released - gofmt for bash code
    story by mvdan · 2016-12-20 · 0 comments
  24. ▲ 1
    shfmt 1.0 released
    story by mvdan · 2016-12-13 · 0 comments
  25. ▲ 2
    shfmt 0.5 released
    story by mvdan · 2016-11-25 · 0 comments
  26. ▲ 1
    Show HN: shfmt – format bash programs
    story by mvdan · 2016-08-23 · 0 comments
  27. ▲ 5
    Show HN: A shell/bash parser and formatter in Go
    story by mvdan · 2016-07-19 · 0 comments
  28. ▲ 2
    Show HN: shfmt – format your shell scripts
    story by mvdan · 2016-06-08 · 0 comments
  29. ▲ 6
    Show HN: shfmt – gofmt for shell scripts
    story by mvdan · 2016-06-07 · 0 comments
  30. is https://github.com/mvdan/sh relevant ?
    comment by pyed · 2016-06-04 · in Shell Style Guide from Google