mirror of
https://github.com/ossf/scorecard.git
synced 2024-11-05 05:17:00 +03:00
Pinned-Dependencies: show where exactly parsing fails (#1297)
Looks like due to https://github.com/mvdan/sh/issues/636 scorecard can't parse comments quoted with backticks like ``` cmd -a \ -b `# withouth backticks -c below would be a separate command` \ -c ``` and fails with something like ``` error parsing shell code: 82:26: reached EOF without closing quote ` ``` This PR turns that message into ``` error parsing shell code: vagrant/bootstrap_scripts/arch-sanitizers-clang.sh: 82:26: reached EOF without closing quote ` ``` which is a bit more useful. Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
This commit is contained in:
parent
6e013cf67d
commit
01ebb0dcf3
@ -768,7 +768,7 @@ func nodeToString(p *syntax.Printer, node syntax.Node) (string, error) {
|
||||
func validateShellFileAndRecord(pathfn string, content []byte, files map[string]bool,
|
||||
dl checker.DetailLogger) (bool, error) {
|
||||
in := strings.NewReader(string(content))
|
||||
f, err := syntax.NewParser().Parse(in, "")
|
||||
f, err := syntax.NewParser().Parse(in, pathfn)
|
||||
if err != nil {
|
||||
// Note: this is caught by internal caller and only printed
|
||||
// to avoid failing on shell scripts that our parser does not understand.
|
||||
|
Loading…
Reference in New Issue
Block a user