Skip to content

Latest commit

 

History

History
130 lines (93 loc) · 3.18 KB

File metadata and controls

130 lines (93 loc) · 3.18 KB

mdValidator.js Analysis

Question: Is node mdValidator.js required for workflows to work?

Short Answer: NO, but it's recommended to keep it.


What mdValidator.js Does

mdValidator.js is a quality control tool that validates the markdown files:

Validation Checks:

  1. Conference entry format - Ensures correct structure
  2. Date formats - Validates DD, DD-DD, DD/MM-DD/MM patterns
  3. Links - Checks for http/https URLs
  4. Spacing - Detects multiple spaces, long dashes
  5. Badges/Shields - Validates CFP, Closed Captions, Scholarship, Sponsoring badges
  6. Badge ordering - Ensures correct badge order
  7. Duplicate tags - Checks TAGS.csv for duplicates

Exit Behavior:

  • Exits with code 1 if more than 1 validation error found
  • Exits with code 1 if duplicate tags found
  • Allows workflow to continue if validation passes

What It Does NOT Do

Does NOT generate files - No all-events.json creation
Does NOT transform data - Pure validation only
Is NOT required for tests - Tests only need mdParser.js output


Test Results

Without mdValidator.js:

# Skip mdValidator.js, run only mdParser.js
node mdParser.js
npm test -- --run

Result: ✅ All 32 tests PASS

With mdValidator.js:

# Run both mdValidator.js and mdParser.js
node mdValidator.js
node mdParser.js
npm test -- --run

Result: ✅ All 32 tests PASS + Quality validation

Recommendation: KEEP mdValidator.js

Why Keep It?

  1. Quality Control 🎯

    • Catches markdown formatting errors early
    • Prevents malformed entries from being deployed
    • Validates badge formats and ordering
  2. Prevents Bad Data 🛡️

    • Stops workflow if >1 formatting error
    • Catches duplicate tags
    • Ensures consistency across files
  3. Zero Performance Impact

    • Runs in milliseconds
    • No overhead for normal workflows
    • Fails fast on errors
  4. Developer Feedback 💬

    • Shows helpful hints for fixing errors
    • Provides clear error messages
    • Validates on every PR

Current Workflow Order (Optimal)

- npm install (tools)
- node mdValidator.js    # ✅ Validate first (fails fast)
- node mdParser.js       # ✅ Generate files
- npm test               # ✅ Run tests

Why This Order is Best:

  1. Fail Fast - If markdown is invalid, stop immediately
  2. No Wasted Work - Don't generate files from bad data
  3. Clear Errors - Validation errors are more helpful than parse errors
  4. Tests Last - Only test if data is valid and generated

Alternative: Skip mdValidator.js (NOT Recommended)

You could skip it:

- npm install (tools)
- node mdParser.js       # Generate files without validation
- npm test               # Tests still pass

But you lose:

  • ❌ Quality checks
  • ❌ Early error detection
  • ❌ Format validation
  • ❌ Duplicate tag detection

Conclusion

Keep mdValidator.js in workflows

The current workflow order is optimal:

  1. Validates markdown quality (fast fail)
  2. Generates JSON files
  3. Runs tests

Impact: Near-zero performance cost, significant quality benefits! 🚀