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

turn validate-prescriptions into pre-commit hook #2408

Merged
merged 3 commits into from
Jan 17, 2023

Conversation

VannTen
Copy link
Member

@VannTen VannTen commented Jan 11, 2023

  • Make Presciption.validate error tolerant and report detailed errors
  • Add pre-commit mode to validate-prescriptions and explicit files passing
  • Pre-commit hook definition

Related Issues and Dependencies

closes #2391
needs thoth-station/python#489 + a release to work

This introduces a breaking change

  • No

This should yield a new module release

  • Yes

We need to keep going even if we encounter an error to get the whole
list.
@VannTen VannTen requested review from goern and sesheta as code owners January 11, 2023 16:14
@VannTen VannTen force-pushed the feat/pre-commit-hook branch from 7917c16 to aa451ff Compare January 11, 2023 16:16
- Passing explicit files instead of directories is necessary to work as
  a pre-commit hook.
- Does not exit early on error to report all of them.

Since there is several places which validates the prescriptions
(voluptous schema + custom codes), we're doing a gross hack by counting
the number of ERROR messages logged to get the count of prescriptions
errors.
@goern goern merged commit ef051d9 into thoth-station:master Jan 17, 2023
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.

Package prescriptions validation as pre-commit hook
2 participants