Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iterative/dvcyaml-schema
Schema for dvc.yaml
https://github.com/iterative/dvcyaml-schema
dvc dvc-yaml jsonschema
Last synced: 3 days ago
JSON representation
Schema for dvc.yaml
- Host: GitHub
- URL: https://github.com/iterative/dvcyaml-schema
- Owner: iterative
- License: apache-2.0
- Created: 2020-06-16T15:48:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T14:17:48.000Z (9 days ago)
- Last Synced: 2024-09-25T19:57:19.084Z (8 days ago)
- Topics: dvc, dvc-yaml, jsonschema
- Language: Python
- Homepage: https://dvc.org/doc/user-guide/project-structure/dvcyaml-files
- Size: 66.4 KB
- Stars: 11
- Watchers: 12
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dvcyaml-schema
[JSON Schema](https://json-schema.org/) for [`dvc.yaml`](https://dvc.org/doc/user-guide/dvc-files-and-directories#dvcyaml-file) file format.
It can provide better autocompletion, validation, and linting for `dvc.yaml` files.
## Usage
### JSON Schema
Use the following URL to obtain the latest JSON schema for `dvc.yaml`:
```
https://raw.githubusercontent.com/iterative/dvcyaml-schema/master/schema.json
```#### Visual Studio Code (with [YAML Extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)):
If you have installed YAML extension, it'll automatically fetch the latest dvcyaml-schema, and
should work out of the box.But you can specify explicitly as well by adding following contents to your settings:
```json
{
"yaml.schemas": {
"https://raw.githubusercontent.com/iterative/dvcyaml-schema/master/schema.json":
"dvc.yaml"
}
}
```You can also specify custom URL or path instead for debugging/testing purposes.
#### JetBrain IDEs (PyCharm, Intellij IDEA, et al.)
Follow [this](https://www.jetbrains.com/help/ruby/yaml.html#remote_json) instruction.
### Important Files:
1. **[schema.json](schema.json)**
2. [gen.py](gen.py)
3. [examples](examples)
4. [tests.py](tests.py)### Contributing
1. Prepare your environment (you'll need `python3.10+` and `pip`).
```console
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
```
2. Install `pre-commit` hook.
```console
$ pip install pre-commit
$ pre-commit install
```
3. Open [gen.py](gen.py), make some adjustments.
4. (Optional) Add [valid](examples/valid) and [invalid](examples/invalid) yaml examples.
5. Commit. `pre-commit` hook should run automatically and format/lint code, generate new schema and run tests.
If there are any new changes, add and try to commit it again.
6. Send us a pull request. 🤗