Skip to content

Conversation

@daveshanley
Copy link
Member

Adds a fix for daveshanley/vacuum#726

A more robust lookup, PropertyNameInfo attempts to provide a valid lookup.

Some flawed logic resulted in a loss of fidelity on location for some violations. a set of callbacks now exist to try and locate the exact location.

New Files Created (2)

  1. schema_validation/property_locator.go (292 lines)
  - Core error extraction and YAML navigation logic
  - 10 functions with single responsibilities
  - Performance optimized (pre-compiled regex, efficient string building)

  2. schema_validation/property_locator_test.go (820 lines)
  - 31 comprehensive tests (27 unit + 4 integration)
  - Tests for all edge cases, nil safety, not found scenarios
  - Issue #726 integration tests included

  Modified Files (2)

  3. schema_validation/validate_document.go (+5 lines)
  - Integrated fallback logic at lines 75-117
  - Optimized: extracts property info once before loop (O(m+n) not O(n*m))

  4. schema_validation/validate_schema.go (+3 lines)
  - Integrated fallback logic at lines 270-333
  - Same optimization applied
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.43%. Comparing base (38ab1b5) to head (f20f732).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #195      +/-   ##
==========================================
+ Coverage   97.34%   97.43%   +0.08%     
==========================================
  Files          42       43       +1     
  Lines        3761     3892     +131     
==========================================
+ Hits         3661     3792     +131     
  Misses        100      100              
Flag Coverage Δ
unittests 97.43% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@daveshanley daveshanley merged commit a320efa into main Nov 6, 2025
4 checks passed
@daveshanley daveshanley deleted the v0.9.1 branch November 6, 2025 23:02
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