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

New validation rules and refactoring #23

Merged
merged 17 commits into from
Mar 14, 2024
Merged

New validation rules and refactoring #23

merged 17 commits into from
Mar 14, 2024

Commits on Mar 13, 2024

  1. Refactoring

    This commit updates the GitHub Actions workflows by adding a new "test-phar" job for verifying the functionality of the PHAR binary. The names and actions of existing jobs were updated to be more informative. The README file was also cleaned up for better readability. Changes also included the addition of planned features related to tool versioning.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    1dbdbe1 View commit details
    Browse the repository at this point in the history
  2. The README has been updated to reflect this change and ensure users a…

    …re aware of the new output format.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    8cf6da1 View commit details
    Browse the repository at this point in the history
  3. Update Docker actions in GitHub Workflow

    Added distinct Docker run actions for valid and invalid CSV file validation in the GitHub workflows main.yml file. Extended the workflow steps to individually deal with valid and invalid CSV files. Related image and volume parameters have been adjusted accordingly to run the validation tests properly.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    8554aac View commit details
    Browse the repository at this point in the history
  4. Refactor Docker action name and enhance code functions

    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    4f4013c View commit details
    Browse the repository at this point in the history
  5. Update PHPStan and Roave/SecurityAdvisories versions

    The commit updates the versions of PHPStan and Roave/SecurityAdvisories in the composer.lock file. Both libraries have been upgraded to newer versions, with the reference and URL addresses correspondingly updated. This ensures that the project is using the most recent
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    cfa2801 View commit details
    Browse the repository at this point in the history
  6. Move autoloader file inclusion to top in CSV blueprint file

    The order of operations in the csv-blueprint.php file was modified to include the JBZOO_AUTOLOAD_FILE at the beginning of the iteration. Previously it was included right before setting the default timezone, potentially causing issues if certain elements needed in the iteration were not loaded properly.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    c45e619 View commit details
    Browse the repository at this point in the history
  7. Update table rendering in ErrorSuite and related tests

    The table rendering in ErrorSuite.php has been refactored to dynamically set column sizes based on terminal width rather than using fixed widths. A new method getTableSize() has been added to calculate and return the sizes. The relevant tests and documentation in README.md, have been adjusted to reflect these changes.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    aaf53ad View commit details
    Browse the repository at this point in the history
  8. Modify column size handling in ErrorSuite and tests

    Adjusted the column size handling in ErrorSuite.php to use 'COLUMNS_TEST' instead of 'COLUMNS' for improved testing flexibility. Also applied changes to Makefile and phpunit.xml.dist files to align with the modification made in ErrorSuite.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    42a5778 View commit details
    Browse the repository at this point in the history
  9. Refactor Validators and Rules structure

    Reorganized and refactored the architecture of Validators and Rules within the codebase. The Rules were moved under the base namespace rather than under Validators. Additionally, implemented the ColumnValidator and ScvValidator, and refactored the abstract base Validator class into AbstractValidator. Adjustments were also applied to unit tests receiving the impact of these changes, ensuring comprehensive test coverage over the refactored structure.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    a5fb85f View commit details
    Browse the repository at this point in the history
  10. Refactor major parts of the validation and rules structure for easier…

    … maintainability and clarity.
    
    The validation code in `CsvFile` has been refactored to a new class, `CsvValidator`, for better encapsulation and readability. The use statements in `CsvFile` and `Column` classes have been updated to reflect these changes. The `AbstractValidator` has been removed for simplicity, hence, `ColumnValidator` and `CsvValidator` classes no longer extend it. Furthermore, a typo in the `CsvValidator` filename was corrected. The commit aims to make the validation process easier to maintain and understand.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    e35d8a5 View commit details
    Browse the repository at this point in the history
  11. Fixes

    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    5aa3e62 View commit details
    Browse the repository at this point in the history
  12. Implement min and max precision rules

    Added new rules for minimum and maximum precision in the schema files and created corresponding validation logic in the PHP files. Updated test files to include tests for these new rules. Enhanced the precision functionality in the schema files and reflected these changes in the README for clarity.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    436bb47 View commit details
    Browse the repository at this point in the history
  13. Update precision description in schema and README

    Clarified precision rules in both full schema and README file by adding a note about inclusion of zeroes in minimum and maximum precision calculations. This will ensure the users understand this particular aspect when dealing with precision logic.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    1ec2368 View commit details
    Browse the repository at this point in the history
  14. Add new string and word count validation rules

    Introduced new validation rules related to string content and word count. The changes include rules for word counting, string beginning and ending content, and required content presence in strings. These modifications expand the ability of the library to perform more intricate validations, aiding in ensuring data consistency and accuracy in CSV files.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    5f4c4ac View commit details
    Browse the repository at this point in the history
  15. Refactor code to remove potential nullability issues

    Updated method signatures across codebase to remove nullable string types for validation input. These changes ensure consistency in handling input values from CSV files. The prior handling could potentially lead to null value related errors, thus this update improves the overall stability of the CSV validation process.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    2757bb1 View commit details
    Browse the repository at this point in the history
  16. Add is_alias validation rule to schema examples

    A new validation rule is_alias has been added to the schema examples in the full.json, full.php and full.yml files. Due to this addition, a new IsAlias.php file is created under src/Rules, which will validate the aliases present in these files. This function is also tested in Blueprint/RulesTest.php.
    Denis Smet committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    861cafa View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2024

  1. Improve validation of rule options in schema files

    Error messages have been added to return statements in the AllMustContain, AtLeastContains, StrEndsWith, and StrStartsWith rules when no value or an empty value is provided in the schema files. This results in more informative feedback. Additionally, corresponding tests have been instituted in the RulesTest.php file to verify the functioning of these updates.
    Denis Smet committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    d0696b0 View commit details
    Browse the repository at this point in the history