SchemaStore / schemastore

A collection of JSON schema files including full API
http://schemastore.org
Apache License 2.0
3.02k stars 1.65k forks source link

File-type `meson` is missing in pre-commit-config.json #4071

Open passionsfrucht opened 5 days ago

passionsfrucht commented 5 days ago

Area with issue?

JSON Schema

✔️ Expected Behavior

When defining an entry in a .pre-commit-config.yaml with specifying the file types as meson, no error should be thrown.

❌ Actual Behavior

The meson type is incorrectly rejected.

sh-3.2$ date -u
Fr Sep 13 12:33:25 UTC 2024
sh-3.2$ wget https://json.schemastore.org/pre-commit-config.json
[...]
sh-3.2$ check-jsonschema --version
check-jsonschema, version 0.29.2
sh-3.2$ check-jsonschema .pre-commit-config.minimal-example.yaml  --schemafile ./pre-commit-config.json
Schema validation errors were encountered.
  .pre-commit-config.minimal-example.yaml::$.repos[0]: {'repo': 'local', 'hooks': [{'id': 'meson check', 'name': 'meson check', 'entry': 'ls', 'types': ['meson'], 'language': 'system'}]} is not valid under any of the given schemas
  Underlying errors caused this.

  Best Match:
    $.repos[0].repo: 'local' is not one of ['meta']
  Best Deep Match:
    $.repos[0].hooks[0].types[0]: 'meson' is not one of ['adobe-illustrator', 'alpm', 'apinotes', 'asar', 'asciidoc', 'ash', 'asm', 'aspectj', 'audio', 'avif', 'awk', 'babelrc', 'bash', 'batch', 'bats', 'bazel', 'bazelrc', 'bib', 'binary', 'bitmap', 'bowerrc', 'browserslistrc', 'bzip2', 'c', 'c#', 'c++', 'c2hs', 'cbsd', 'clojure', 'clojurescript', 'cmake', 'codespellrc', 'coffee', 'coveragerc', 'crystal', 'csh', 'cson', 'csproj', 'css', 'csslintrc', 'csv', 'cuda', 'cython', 'dart', 'dash', 'def', 'diff', 'directory', 'dockerfile', 'dockerignore', 'dotenv', 'dtd', 'editorconfig', 'edn', 'ejs', 'eot', 'eps', 'erb', 'executable', 'expect', 'file', 'fish', 'flake8', 'gdscript', 'geojson', 'gherkin', 'gif', 'gitattributes', 'gitconfig', 'gitignore', 'gitlint', 'gitmodules', 'go', 'go-mod', 'go-sum', 'gotmpl', 'gpx', 'graphql', 'groovy', 'gyb', 'gyp', 'gzip', 'handlebars', 'haskell', 'hcl', 'header', 'hgrc', 'html', 'icalendar', 'icns', 'icon', 'idl', 'idris', 'image', 'inc', 'ini', 'inl', 'ino', 'inx', 'jade', 'jar', 'java', 'java-properties', 'javascript', 'jenkins', 'jinja', 'jpeg', 'jshintrc', 'json', 'json5', 'jsonnet', 'jsx', 'jupyter', 'kml', 'kotlin', 'ksh', 'lean', 'lektor', 'lektorproject', 'less', 'liquid', 'literate-haskell', 'lua', 'mailmap', 'makefile', 'manifest', 'map', 'markdown', 'mdx', 'mention-bot', 'mib', 'modulemap', 'musescore', 'myst', 'ngdoc', 'nim', 'nimble', 'nix', 'non-executable', 'npmignore', 'nunjucks', 'objective-c', 'objective-c++', 'ocaml', 'otf', 'p12', 'pdbrc', 'pdf', 'pem', 'perl', 'php', 'pkgbuild', 'plain-text', 'plantuml', 'plist', 'png', 'pofile', 'powershell', 'prettierignore', 'prisma', 'proto', 'puppet', 'purescript', 'pyi', 'pylintrc', 'pypirc', 'pyproj', 'python', 'python2', 'python3', 'pyz', 'qml', 'r', 'relax-ng', 'rst', 'ruby', 'rust', 'salt', 'sass', 'sbt', 'scala', 'scheme', 'scss', 'sh', 'shell', 'sln', 'socket', 'solidity', 'spec', 'sql', 'stylus', 'svelte', 'svg', 'swf', 'swift', 'swiftdeps', 'symlink', 'system-verilog', 'tar', 'tcsh', 'terraform', 'tex', 'text', 'thrift', 'tiff', 'toml', 'ts', 'tsv', 'tsx', 'ttf', 'twig', 'twisted', 'txsprofile', 'urdf', 'vb', 'vbproj', 'vcxproj', 'vdx', 'verilog', 'vhdl', 'vim', 'vtl', 'vue', 'wav', 'webp', 'wheel', 'wkt', 'woff', 'woff2', 'wsgi', 'xhtml', 'xml', 'xquery', 'xsd', 'xsl', 'yaml', 'yamllint', 'yang', 'yin', 'zcml', 'zig', 'zip', 'zpt', 'zsh']

  3 other errors were produced. Use '--verbose' to see all errors.

But the tool used by pre-commit and pre-commit proper identifies the file properly:

sh-3.2$ identify-cli meson.build
["file", "meson", "non-executable", "text"]

I first saw this behavior using vscode, but everything was fully reproducible with more basic tools, as shown above.

image

YAML or JSON file that does not work.

repos:

IDE or code editor.

None

Are you making a PR for this?

No, someone else must create the PR.

passionsfrucht commented 5 days ago

Are you making a PR for this?

No, someone else must create the PR.

Actually, I could image adding the missing file type(s) (I'd guess there are more), but currently time is quite limited for me, unfortunately.