hashicorp / hashicorp/nomad

Output errors from nomad validate in line number:column: message form

Open
#16,169 2 comments 1 reaction 0 assignees View on GitHub
stage/needs-discussion theme/hcl type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal

Current output from nomad validate is rather for humans:

```
$ nomad validate /tmp/file.nomad
Driver configuration not validated since connection to Nomad agent couldn't be established.

Job validation errors:
2 errors occurred:
* Invalid job type: "sfdsavice"
* Task group cache validation failed: 2 errors occurred:
* Job type "sfdsavice" does not allow update block
* Job type "sfdsavice" does not allow migrate block
```

Please standardize output from nomad validate to something that can be parsable by machine. At best, please follow the format from gcc: `{file}:{line}:{column}: {severity}: {message}`.

### Use-cases
I wanted to add automatic nomad validate to my IDE. However, I do not know to which line the errors refer to, so it's kind of confusing.

### Attempted Solutions

`nomad validate --help` does not mention anything useful.

Thanks for making Nomad!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the nomad validate command and inspect how validation errors are currently rendered; use the reported gcc-style format as the acceptance target. Done means errors include file, line, column, severity, and message in machine-parseable output suitable for IDE integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.