Skip to content

Conversation

@jackchuka
Copy link
Owner

This pull request introduces several improvements to the documentation schema system, focusing on simplifying the schema syntax for required and forbidden text patterns, enhancing example schemas, and expanding integration tests. The changes remove the need for explicit regex: true flags, clarify documentation, and provide more robust and maintainable schema examples and tests.

Schema Syntax and Documentation Improvements:

  • Simplified required and forbidden text schema syntax: schemas now use "text" for literal substring matches and {pattern: "..."} for regex, removing the need for regex: true. Documentation in README.md is updated to reflect this, and examples are clarified throughout. [1] [2] [3] [4] [5] [6] [7]

Example Schemas and Documentation:

  • Added new, clearer example schemas: examples/README.mdschema.yml, examples/requirements.mdschema.yml, and examples/tutorial.mdschema.yml replace older, less flexible schemas. These new examples demonstrate best practices and advanced features like regex patterns and allow_additional. [1] [2] [3] [4]
  • Added a practical tutorial Markdown file (examples/tutorial.md) that matches the new tutorial schema, providing a real-world usage example.
  • Removed outdated or redundant example schema files. [1] [2]

Integration and Testing Enhancements:

  • Introduced new integration tests in internal/integration/examples_test.go to ensure that all example schemas validate their corresponding Markdown files, and to verify heading and required text pattern syntax (literal, regex, and expression forms).

Rule Engine Refactoring:

  • Refactored the implementation of required and forbidden text rules to use the new pattern structure, supporting both literal and regex forms without needing a regex boolean. Updated error messages and code generation to reflect the new schema structure. [1] [2] [3] [4] [5] [6]

Internal Code Improvements:

  • Minor improvements to internal code, such as clarifying comments and ensuring additional types are explicitly defined in the JSON schema generator.

These changes collectively make schema authoring simpler and more consistent, improve user-facing documentation, and ensure robust validation through enhanced testing.

@jackchuka
Copy link
Owner Author

@copilot can you summarize this breaking change?

Copy link
Contributor

Copilot AI commented Jan 31, 2026

@jackchuka I've opened a new pull request, #35, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@jackchuka jackchuka marked this pull request as ready for review January 31, 2026 05:49
@jackchuka jackchuka merged commit e592abb into main Jan 31, 2026
1 check passed
@jackchuka jackchuka deleted the feat/rule/regex-handling branch January 31, 2026 05:49
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