Skip to content

Conversation

@revonetworx
Copy link

@revonetworx revonetworx commented Jun 12, 2025

Implement Robust Author Metadata Validation

Description

Task

Create validation for author metadata

Acceptance Criteria

  • Author names must not be nil or empty
  • Author names must be 100 characters or less
  • Whitespace-only names are considered invalid
  • Validation method returns boolean result
  • Supports Unicode characters in author names

Summary of Work

This pull request enhances the author metadata validation system for Jekyll blog posts, ensuring data integrity and consistent author information.

Changes Made

  • Implemented comprehensive author metadata validation in src/author_validator.rb
  • Added detailed validation tests in test/author_validator_spec.rb
  • Established clear validation rules for author metadata

Validation Rules

  1. Author name cannot be nil or empty
  2. Author name must not exceed 100 characters
  3. Trims whitespace to prevent invalid entries
  4. Provides a flexible validation method for future extensions

Implementation Details

  • Used a class method validate for easy static validation
  • Defined a constant MAX_NAME_LENGTH for easy configuration
  • Supports Unicode characters in author names
  • Gracefully handles edge cases like nil or whitespace inputs

Testing Approach

  • Comprehensive test suite covering various validation scenarios
  • Tested valid and invalid input cases
  • Ensured robust error handling and input validation

Future Improvements

  • Potentially add regex-based character validation
  • Support for more complex author metadata (e.g., multiple authors)

Changes Made

  • Updated src/author_validator.rb to implement comprehensive validation
  • Enhanced test/author_validator_spec.rb with additional test cases
  • Established MAX_NAME_LENGTH constant for configurable validation
  • Implemented trim and validation logic in validation method

Tests

  • Validate author names with standard characters
  • Validate author names at maximum length
  • Reject nil author names
  • Reject empty string author names
  • Reject whitespace-only author names
  • Reject author names exceeding maximum length

Signatures

Staking Key

92nc36jkQmefTpRVTMvh2EhFDuv5zt3AUwUzXhtMTzN2: SwU2toGsG2kupgfiSHz2Q1h9fxUFHMcbu6XVXD7NEfJD5YDs5nJo6PKehT2UMkAs9q4pNVN71PrmKyfaf8AijrgntiYLT4nMxHShUbFCpMAXjSbShUfnraLJW6vwxfLHFU4BVig1UqgikZc7ohGPJU51M37JdnDgnnY5qg4sCAmR5SAPV1HwUvTkSDwqgxRBA3cRv9uqujYAcZtD4jGML6Er8NryESTByF2BDxfuezMMra1QnTuWYe3ZZ7RKoJXimF2VozFAGsw5N79NYYxXgWgY2QgBjRutYvFFk2cweuoL9Qfb43ZeRXk4Sh992fShcVvvXREgYEF7sC7oEiFAzKgmq7TBdJARvgb9ycf7m6E9ARcJRaeUHQwRuMyZmer7mzPTTq7yVgfg2Gqwc794teTydciVFaRQpxLDwA

Public Key

61HHm6i5JeijUrDDp4koPcrGEs4Ad8Uga8FjewDb6mZa: GHSGzPdpt3i2ehLzofRnitYkgU8DL4ejf9zodUF4ESXMq2ZyQvLYYeMUxXmBqGtj67HufPYN9GT9c8igm4THAxMfLcWQuqVEGZEcESKsVh6Wdpos1B1ARc7HyYUHf8fz7nc7B88ZqXmUR7tZQNrEm9UUVeRkrybCv7jbjEPf3Aw8ejC3xzsSzBMEXzrnJd55xXRkNnvpEtWtvSJ5884nuMmnARpLfynvhhgSGeTofja9dKJ16U6XfoNKyMqKb1L2136KvjaoCAgYnKEENE5znUCg3XnhomJdSanuwUcLCuBbwYTQ6mYEaFBFJMJ6gX6Yv4Jm2h8yr2rRVEjWb56KmAKVm38izpQhyNg8Jx6JTJhuBf1BTbUGpXZnFMz3gUD5Bgw19Btycp4cPqzTRosG9UrwUfoZBaVpTTXE2Y

@revonetworx revonetworx changed the title [WIP] Implement Author Metadata Validation for Jekyll Blog Implement Robust Author Metadata Validation Jun 12, 2025
@revonetworx revonetworx marked this pull request as ready for review June 12, 2025 18:52
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.

1 participant