PureYAML/Sources/Validation
Mihaela M df3d43804c feat(parsing): scope %TAG per document, diagnose undefined handles
A tag shorthand using a named handle (`!handle!suffix`) must be declared by a
`%TAG` directive in the document that uses it; the handle does not carry across
documents (YAML 1.2). The parser was permissive but silent here, so an
undeclared handle passed unnoticed.

- Scope tag handles per document: a `%TAG` handle now applies only to the
  document it precedes (merged onto the defaults at the document start, cleared
  at the boundary) instead of accumulating across the whole stream. A directive
  repeated for each document keeps working, as the suite requires.
- Detect the named-handle form before the primary-handle fallback (which
  previously masked `!prefix!x` as a local tag) and record an undeclared handle.
  The parse stays permissive: it still yields a value, and
  `PureYAML.validationReport` surfaces the issue as an `undefinedTagHandle`
  error. The check reads the scanner's tokens, so it is exact: a `!x!` inside a
  scalar or comment is never flagged.

Extracts `Scanner.State` and the tag helpers into their own files to keep each
source file within the 400-line limit. Adds focused tests; the full suite and
strict lint stay green.
2026-06-29 07:54:55 +02:00
..
AnyCheck.swift refactor(validation): fold the tagged validator onto one framework 2026-06-28 10:41:10 +02:00
Check.Builtins.swift refactor(validation): retire the legacy Rule for one check type 2026-06-28 16:43:31 +02:00
Check.Combinators.swift refactor(validation): fold the tagged validator onto one framework 2026-06-28 10:41:10 +02:00
Check.swift refactor(validation): fold the tagged validator onto one framework 2026-06-28 10:41:10 +02:00
DiagnosticValidation.swift feat(parser): harden diagnostics and streaming 2026-06-06 07:57:48 +02:00
Issue.Collection.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
Issue.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
Path.Component.swift feat(model): support complex mapping keys 2026-06-05 16:08:45 +02:00
Path.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
PreflightScanner.swift feat(parser): harden diagnostics and streaming 2026-06-06 07:57:48 +02:00
Result.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
Severity.swift feat(package): bootstrap pure swift yaml package 2026-06-05 06:34:20 +02:00
SubjectContext.swift refactor(validation): fold the tagged validator onto one framework 2026-06-28 10:41:10 +02:00
Validatable.swift feat(validation): enforce tagged mapping-key uniqueness 2026-06-28 17:03:20 +02:00
Validation.BatchReport.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.Diagnostic.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.DiagnosticKind.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.Report.swift feat(parsing): scope %TAG per document, diagnose undefined handles 2026-06-29 07:54:55 +02:00
Validation.ReportError.swift feat(validation): add diagnostic report errors 2026-06-05 21:06:42 +02:00
Validation.Source.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validation.SourceReport.swift refactor(code-style): one top-level type per source file 2026-06-26 06:14:21 +02:00
Validator.swift refactor(validation): retire the legacy Rule for one check type 2026-06-28 16:43:31 +02:00