I have a .github/workflows/site.yml file that matches multiple entries from schemastore catalog:
{
"name": "Ansible Playbook",
"description": "Ansible playbook files",
"fileMatch": [
"playbook.yml",
"playbook.yaml",
"site.yml",
"site.yaml",
"**/playbooks/*.yml",
"**/playbooks/*.yaml"
],
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json#/$defs/playbook"
}
and
{
"name": "GitHub Workflow",
"description": "YAML GitHub Workflow",
"fileMatch": [
"**/.github/workflows/*.yml",
"**/.github/workflows/*.yaml",
"**/.gitea/workflows/*.yml",
"**/.gitea/workflows/*.yaml",
"**/.forgejo/workflows/*.yml",
"**/.forgejo/workflows/*.yaml"
],
"url": "https://www.schemastore.org/github-workflow.json"
}
Unfortunately, actually, Ansible Playbook is selected, which generates lots of false warnings in the file.
Could it be possible to prioritize the selection of the schema according to the number of characters matched outside of wildcards?
This way the more specific fileMatch will be selected if more that one match.
For example in my case, .github/workflows/site.yml:
- matches 8 characters for
site.yml
- matches 23 characters for
**/.github/workflows/*.yml, excluding characters matched by wildcards
The second one is more specific characters and should be preferred
This should fix most of the cases relatively easily
Regards
I have a .github/workflows/site.yml file that matches multiple entries from schemastore catalog:
{ "name": "Ansible Playbook", "description": "Ansible playbook files", "fileMatch": [ "playbook.yml", "playbook.yaml", "site.yml", "site.yaml", "**/playbooks/*.yml", "**/playbooks/*.yaml" ], "url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json#/$defs/playbook" }and
{ "name": "GitHub Workflow", "description": "YAML GitHub Workflow", "fileMatch": [ "**/.github/workflows/*.yml", "**/.github/workflows/*.yaml", "**/.gitea/workflows/*.yml", "**/.gitea/workflows/*.yaml", "**/.forgejo/workflows/*.yml", "**/.forgejo/workflows/*.yaml" ], "url": "https://www.schemastore.org/github-workflow.json" }Unfortunately, actually,
Ansible Playbookis selected, which generates lots of false warnings in the file.Could it be possible to prioritize the selection of the schema according to the number of characters matched outside of wildcards?
This way the more specific fileMatch will be selected if more that one match.
For example in my case,
.github/workflows/site.yml:site.yml**/.github/workflows/*.yml, excluding characters matched by wildcardsThe second one is more specific characters and should be preferred
This should fix most of the cases relatively easily
Regards