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

Add custom directive to be consumed by external scripts #244

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

skorulis-ap
Copy link
Collaborator

@skorulis-ap skorulis-ap commented Feb 6, 2025

This adds a // @knit custom("...") directive which knit simply passes through into the JSON output. This allows external apps to define custom tags that can be consumed by scripts.
The current planned usage is to have something like // @knit custom("skip_validation") which will be consumed by an external validate command to provide an escape hatch for edge cases.

I'm not particularly wedded to the name custom so if anyone has a suggestion please let me know.

@skorulis-ap skorulis-ap marked this pull request as ready for review February 6, 2025 22:52
@skorulis-ap skorulis-ap requested a review from bradfol February 6, 2025 22:52
Copy link
Collaborator

@bradfol bradfol left a comment

Choose a reason for hiding this comment

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

What do you think about including the code for the validation logic within Knit as well? That would make it more of a first-class command than a custom passthrough

@skorulis-ap skorulis-ap force-pushed the skorulis/custom-directive branch from 4cf738b to 5313d89 Compare February 20, 2025 03:19
@skorulis-ap
Copy link
Collaborator Author

What do you think about including the code for the validation logic within Knit as well? That would make it more of a first-class command than a custom passthrough

I've been thinking this through and for the first version of validation I want to treat it as a problem specific to a single codebase and then later look at how it can be generalised.

@skorulis-ap skorulis-ap merged commit a59aebc into main Feb 20, 2025
1 check passed
@skorulis-ap skorulis-ap deleted the skorulis/custom-directive branch February 20, 2025 20:28
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.

2 participants