You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if only the most specific error(s) were reported. For example, given this GitHub Actions workflow file:
name: Pushon: pushjobs:
test:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4with:
node-version: 20cache: npm
- runn: npm install # <-- whoopsie, a typo!
- rn: npm run build # <-- uhoh, another one!
- run: npm run test
- run: npm run lint
You get the following errors:
4:3 error "jobs.test" must have required property 'uses' json-schema-validator/no-invalid
4:3 error "jobs.test" must match exactly one schema in oneOf json-schema-validator/no-invalid
5:5 error Unexpected property "jobs.test["runs-on"]" json-schema-validator/no-invalid
6:5 error Unexpected property "jobs.test.steps" json-schema-validator/no-invalid
12:9 error "jobs.test.steps[2]" must have required property 'uses' json-schema-validator/no-invalid
12:9 error "jobs.test.steps[2]" must have required property 'run' json-schema-validator/no-invalid
12:9 error "jobs.test.steps[2]" must match exactly one schema in oneOf json-schema-validator/no-invalid
12:9 error Unexpected property "jobs.test.steps[2].runn" json-schema-validator/no-invalid
13:9 error "jobs.test.steps[3]" must have required property 'uses' json-schema-validator/no-invalid
13:9 error "jobs.test.steps[3]" must have required property 'run' json-schema-validator/no-invalid
13:9 error "jobs.test.steps[3]" must match exactly one schema in oneOf json-schema-validator/no-invalid
13:9 error Unexpected property "jobs.test.steps[3].rn" json-schema-validator/no-invalid
This can cause some confusion/churn; ideally just the Unexpected property "jobs.test.steps[2].runn" and Unexpected property "jobs.test.steps[3].rn" would get reported. I tried setting ajv's allErrors: false to reduce the noise, but that's worse (although the run error provides a good hint for the first typo, the second typo is not reported):
4:3 error "jobs.test" must have required property 'uses' json-schema-validator/no-invalid
4:3 error "jobs.test" must match exactly one schema in oneOf json-schema-validator/no-invalid
12:9 error "jobs.test.steps[2]" must have required property 'uses' json-schema-validator/no-invalid
12:9 error "jobs.test.steps[2]" must have required property 'run' json-schema-validator/no-invalid
12:9 error "jobs.test.steps[2]" must match exactly one schema in oneOf json-schema-validator/no-invalid
I haven't dug into the code too deeply, but it seems like it should be possible to just keep the most specific errors (i.e. for each error we encounter, discard any errors from ancestor nodes). Perhaps this could be opt-in to start, WDYT? I'd be happy to create a PR if you're interested in this feature.
The text was updated successfully, but these errors were encountered:
I haven't dug into the code too deeply, but it seems like it should be possible to just keep the most specific errors (i.e. for each error we encounter, discard any errors from ancestor nodes). Perhaps this could be opt-in to start, WDYT? I'd be happy to create a PR if you're interested in this feature.
It would be great if only the most specific error(s) were reported. For example, given this GitHub Actions workflow file:
You get the following errors:
This can cause some confusion/churn; ideally just the
Unexpected property "jobs.test.steps[2].runn"
andUnexpected property "jobs.test.steps[3].rn"
would get reported. I tried setting ajv'sallErrors: false
to reduce the noise, but that's worse (although therun
error provides a good hint for the first typo, the second typo is not reported):I haven't dug into the code too deeply, but it seems like it should be possible to just keep the most specific errors (i.e. for each error we encounter, discard any errors from ancestor nodes). Perhaps this could be opt-in to start, WDYT? I'd be happy to create a PR if you're interested in this feature.
The text was updated successfully, but these errors were encountered: