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

CLI scaffolding for YAMLValidator #662

Closed
wants to merge 5 commits into from

Conversation

abaskk-msft
Copy link
Contributor

Problem

N/A

Solution

N/A

Changes

  • Adds the initial CLI scaffolding and verification for the YAML validator, which for now, only verifies file extemsions and validates the files and directories exists.
  • The added command includes the validate CLI command, flags include:
    • required --path a path to a .yaml or folder of .yaml files
    • optional --schema a path to a local schema .json file, or a default one if it is not passed in.

Testing

  • For now only manual tests were done to verify input filepaths, these tests included
    1. No parameters passed to cli
    2. Validate command without parameters
    3. Validate command with an invalid and valid file path
    4. Validate command with an invalid and valid folder path
    5. Path option input validation to check at least 1 .yaml file exists in a folder
    6. Path option input validation to check Verification that a file has .yaml extension
    7. Check that schema path option input exists in the file system and is a .json file.
    8. Also note, windows wont allow a file and folders with the same name to exist in a path, so this case was ignored
  • Perhaps later, tests for this project can be made an run in a new project called YAMLValidator.Tests

@abaskk-msft abaskk-msft requested review from a team as code owners June 1, 2024 00:08
Copy link
Contributor

@mizrael mizrael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend writing some unit tests before merging into master. The cases outlined in the PR description should be ok for now

@petrochuk petrochuk closed this Jun 24, 2024
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.

3 participants