feat(stdlib): add validation library (#20)#23
Conversation
|
yeah take your time please free to tag me and discuss about this |
|
Thanks for the contribution and the comprehensive documentation. This is a substantial addition to the standard library, so I'll take some time to review the implementation, API design, tests, and documentation before making a decision. I also noticed the Windows CI failure again. Since this has occurred on multiple PRs, I'll verify whether it's a repository/CI issue or something introduced by this change. I'll update you after the review. Thanks for your patience! |
|
@ProgrammerKR Root CauseThe official LLVM Windows installer and Chocolatey package don't ship This also explains why the Windows runner itself recently dropped FixReplace the custom PowerShell script with In - name: Install LLVM and Clang
if: matrix.os == 'windows-latest'
uses: KyleMayes/install-llvm-action@v2
with:
version: "17"
- name: Set LLVM_DIR (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
echo "LLVM_DIR=${{ env.LLVM_PATH }}/lib/cmake/llvm" >> $env:GITHUB_ENV
echo "CMAKE_PREFIX_PATH=${{ env.LLVM_PATH }}" >> $env:GITHUB_ENVAfter this,
|
|
@bastitva0-blip Thanks for investigating and sharing the root cause. Could you please create a separate issue for this Windows CI/LLVM setup problem with the details and proposed solution? I'll assign it to you. If you'd like to work on it, feel free to submit a PR to fix it. Otherwise, I'll take care of implementing the fix myself. Thanks again for your contribution and the detailed research! |
PR Body
Description
This PR implements the feature request outlined in #20, introducing the
std.lib.validationstandard library module for ProXPL. It provides a robust, declarative, and chainable API for schema-based data validation and quick runtime data validation checks, perfectly matching the language's "batteries included" philosophy.This library operates entirely in userland ProXPL using core built-ins, introducing zero overhead or modifications to the native C/C++ core engine.
Related Issues
Closes #20
Proposed Changes
std/lib/validation.prox): Implements chainable rules forstring(),number(),bool(),list(), andany()types.Schema.define()andschema.validate()to parse payloads and return complete, structuredValidationResultobjects with accumulated error lists rather than failing early.Validate.*): Adds quick, standalone convenience methods (e.g.,Validate.isEmail,Validate.isInRange) for minor runtime assertions.tests/test_validation.prox): Thoroughly tests edge cases, validation boundaries, and nested type evaluation.docs/stdlib/validation.mdand updatedstd/README.mdandCHANGELOG.md.File Statistics & Changes