Skip to content

Errors do not specify which file they occur in when multiple files are passed to a subcommand #2194

Closed
@SiriusStarr

Description

@SiriusStarr

#2169 was great and allows one to pass multiple files at once to e.g. dhall freeze. However, currently no information about which file fails is output to the user, making it very difficult to track down the problem if many files are passed.

For example:

echo 0 > a.dhall 

echo 0f > b.dhall

dhall freeze a.dhall b.dhall
dhall: 
Error: Invalid input

(input):1:2:
  |
1 | 0f
  |  ^
unexpected 'f'
expecting "", "", "", "", ->, //, //\\, /\, :, end of input, keyword, operator, or whitespace

If instead the error were output as:

dhall: 
Error: Invalid input

(./b.dhall):1:2:
  |
1 | 0f
  |  ^
unexpected 'f'
expecting "", "", "", "", ->, //, //\\, /\, :, end of input, keyword, operator, or whitespace

or something instead of just (input) it would be much more clear.

This also occurs with e.g. dhall lint

As such, I've been unable to use the new multi-file commands in my CI and am stuck doing something like:

for n; do echo "$n"; dhall lint --check "$n" || exit 1; done

which of course still works but it would be great to use the new option to process multiple files at once, since it's currently a pain to track down what the issue is if you're linting 500 files at once. 😄

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions