sh icon indicating copy to clipboard operation
sh copied to clipboard

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

Results 141 sh issues
Sort by recently updated
recently updated
newest added

For example, `ParamExp` has a `Name` field of type `*Lit`, but it can never be nil. The reason it's a pointer is for consistency with all the other literal fields.

I have a demo using `[email protected]` [working on CodeSandbox](https://codesandbox.io/s/tty-demo-1-tvmco3?file=/src/sh/parse/parse.service.ts). But I had to [comment out two similar lines](https://github.com/rob-myers/mvdan-sh/commit/55b9f5eb908e3768c176ca502468cdc35951029e): ```js $r = os.$init(); /* */ $s = 5; case 5: if($c)...

help wanted

I'm using Task and hit this issue and was directed here: https://github.com/go-task/task/issues/392#issuecomment-1141300882 I want my script to fail on pipe errors. `cmd1` works/fails as expected, but `cmd2` never fails: ```yaml...

Currently shfmt strips trailing spaces between the last word of line and a backslash: ``` a_command \ with \ many \ options \ and \ arguments ``` becomes ``` a_command...

Congratz for the great tool! Would be nice to have zsh support.

@andreynering mentioned the name Dialect and it instantly feels like a better and shorter name. It's also much clearer on its own, without needing to say LangDialect.

There have been a few discussions in other issues, such as @rob-myers' suggestions in #298. As a start: * Replace `syntax.NodeType` with a field in each node, such as `n.type`...

enhancement
help wanted

See title. Is there some other way to signal a Runner (something analogous to SIGINT) that I'm missing?

bug
help wanted

Some extra whitespace is added before trailing comments after 1. brace groups ```sh { foo #inline } #trailing foo() { bar #inline } #trailing ``` ```sh { foo #inline }...

Right now, the `Shebang` API uses a shell-specific regular expression: https://github.com/mvdan/sh/blob/43a160083ea11d3d02f66c6ac748ae4c64ab4bc3/fileutil/file.go#L16 This will work for shell shebangs like `#!/usr/bin/bash`, but not for others like `#!/usr/bin/python`. There's not really a good...