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

[Feature] Support checking model-index.yml #8

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zhouzaida
Copy link
Member

@zhouzaida zhouzaida commented Jul 17, 2022

Modify .pre-commit-config.yaml with the following config to test this hook.

  - repo: https://github.com/zhouzaida/pre-commit-hooks-1
    rev: 0672dd0  # Use the ref you want to point at
    hooks:
      - id: check-model-index
        args: ["model-index.yml"]  # replace the dir_to_check with your expected directory to check
        additional_dependencies:
          - cerberus

In addition, since YAML does not support tuple type, the resolution field in a metafile is recognized as a string, so fix this type to be a list. You can use the following regular expression global replacement in vs code

  • resolution: \(([0-9]*), ([0-9]*)\)
  • resolution: [$1, $2]

image

@zhouzaida zhouzaida marked this pull request as draft July 17, 2022 08:20
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.

None yet

1 participant