Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine which schemas to use based off of priority #362

Merged
merged 6 commits into from
Dec 14, 2020

Conversation

JPinkney
Copy link
Contributor

@JPinkney JPinkney commented Nov 26, 2020

Signed-off-by: Josh Pinkney [email protected]

What does this PR do?

This PR implements schema priority. The priority level is modeline > settings schema > schema association > schema store, meaning that if you have a modeline in the file then it overrides everything else associated with the file. Likewise, if you have schema set on the file manually through yaml.settings it will override schema associations and the schema store.

What issues does this PR fix or reference?

Is it tested? How?

You can test manually by creating a .travis.yml file. Observe that it is associated with the .travis.yml schema. Then associate a schema manually to .travis.yml

"yaml.schemas": {
    "https://json.schemastore.org/composer": ".travis.yml"
}

and observe that the composer schema is now picked up and the travis schema from the schema store is not

@coveralls
Copy link

coveralls commented Nov 27, 2020

Coverage Status

Coverage increased (+0.2%) to 80.391% when pulling 989ca8f on schema-priority into ce1609d on master.

@JPinkney JPinkney marked this pull request as ready for review November 27, 2020 17:35
Signed-off-by: Josh Pinkney <[email protected]>
@ssbarnea
Copy link
Member

ssbarnea commented Dec 1, 2020

I was surprised today to observe that the extension decided to wrongly use "phpdeploy" schema from unknown location regardless the fact that I did configure it to use ansible-playbook schema for that file pattern.

I think it should have being obvious that user-configured yaml.schemas in settings.json should take precedence.

Apparently after a while I ended up having two schemas reporting errors for the same file, one configured by me and the surprise one which I do not know how to disable.

Signed-off-by: Yevhen Vydolob <[email protected]>
@evidolob evidolob added this to the 0.14.0 milestone Dec 9, 2020
@JPinkney JPinkney merged commit b9b5225 into master Dec 14, 2020
@JPinkney JPinkney deleted the schema-priority branch December 14, 2020 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants