diff --git a/README.md b/README.md index efaa8ed..cb5e1c5 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ slnx-validator MySolution.slnx [FAIL] MySolution.slnx MySolution.slnx - - line 5: [SLNX0013] The element 'Folder' in namespace '...' has invalid child element 'Folder'. List of possible elements expected: 'Project'. - - line 12: [SLNX0011] File not found: docs\CONTRIBUTING.md + - line 5: [SLNX013] The element 'Folder' in namespace '...' has invalid child element 'Folder'. List of possible elements expected: 'Project'. + - line 12: [SLNX011] File not found: docs\CONTRIBUTING.md ``` ### Multiple files — mixed results @@ -86,8 +86,8 @@ slnx-validator src\ [FAIL] src\Backend.slnx src\Backend.slnx - - line 4: [SLNX0011] File not found: docs\CONTRIBUTING.md - - line 8: [SLNX0012] Wildcard patterns are not supported in file paths: docs\*.md + - line 4: [SLNX011] File not found: docs\CONTRIBUTING.md + - line 8: [SLNX012] Wildcard patterns are not supported in file paths: docs\*.md ``` ## What is validated @@ -116,13 +116,13 @@ The following are **intentionally out of scope** because the toolchain already h | Code | Name | Description | |------|------|-------------| -| `SLNX0001` | `FileNotFound` | The input `.slnx` file does not exist. | -| `SLNX0002` | `InvalidExtension` | The input file does not have a `.slnx` extension. | -| `SLNX0003` | `NotATextFile` | The file is binary and cannot be parsed as XML. | -| `SLNX0010` | `InvalidXml` | The file is not valid XML (see [`examples/invalid-not-xml.slnx`](examples/invalid-not-xml.slnx)). | -| `SLNX0011` | `FileNotFound` | A file referenced in `` does not exist on disk. | -| `SLNX0012` | `InvalidWildcardUsage` | A `` contains a wildcard pattern (see [`examples/invalid-wildcard.slnx`](examples/invalid-wildcard.slnx)). | -| `SLNX0013` | `XsdViolation` | The XML structure violates the schema, e.g. `` inside `` (see [`examples/invalid-xsd.slnx`](examples/invalid-xsd.slnx)). | +| `SLNX001` | `FileNotFound` | The input `.slnx` file does not exist. | +| `SLNX002` | `InvalidExtension` | The input file does not have a `.slnx` extension. | +| `SLNX003` | `NotATextFile` | The file is binary and cannot be parsed as XML. | +| `SLNX010` | `InvalidXml` | The file is not valid XML (see [`examples/invalid-not-xml.slnx`](examples/invalid-not-xml.slnx)). | +| `SLNX011` | `ReferencedFileNotFound` | A file referenced in `` does not exist on disk. | +| `SLNX012` | `InvalidWildcardUsage` | A `` contains a wildcard pattern (see [`examples/invalid-wildcard.slnx`](examples/invalid-wildcard.slnx)). | +| `SLNX013` | `XsdViolation` | The XML structure violates the schema, e.g. `` inside `` (see [`examples/invalid-xsd.slnx`](examples/invalid-xsd.slnx)). | ## XSD Schema diff --git a/examples/invalid-not-xml.slnx b/examples/invalid-not-xml.slnx index afe74b5..0dd67a7 100644 --- a/examples/invalid-not-xml.slnx +++ b/examples/invalid-not-xml.slnx @@ -1,2 +1,2 @@ This file intentionally contains plain text instead of XML, -to demonstrate the SLNX0010 InvalidXml error. +to demonstrate the SLNX010 InvalidXml error. diff --git a/src/SLNX-validator.Core/ValidationResults/ValidationErrorCodeExtensions.cs b/src/SLNX-validator.Core/ValidationResults/ValidationErrorCodeExtensions.cs index 35d24b0..07dd4cf 100644 --- a/src/SLNX-validator.Core/ValidationResults/ValidationErrorCodeExtensions.cs +++ b/src/SLNX-validator.Core/ValidationResults/ValidationErrorCodeExtensions.cs @@ -3,5 +3,5 @@ namespace JulianVerdurmen.SlnxValidator.Core.ValidationResults; public static class ValidationErrorCodeExtensions { public static string ToCode(this ValidationErrorCode code) => - $"SLNX{(int)code:D4}"; + $"SLNX{(int)code:D3}"; } diff --git a/tests/SLNX-validator.Core.Tests/SlnxValidatorTests.cs b/tests/SLNX-validator.Core.Tests/SlnxValidatorTests.cs index 47d0eae..4f4ac46 100644 --- a/tests/SLNX-validator.Core.Tests/SlnxValidatorTests.cs +++ b/tests/SLNX-validator.Core.Tests/SlnxValidatorTests.cs @@ -146,12 +146,12 @@ public async Task ValidateAsync_WildcardInFilePath_ReturnsInvalidWildcardUsageEr [Test] public async Task ValidationErrorCode_ToCode_ReturnsPrefixedCode() { - ValidationErrorCode.FileNotFound.ToCode().Should().Be("SLNX0001"); - ValidationErrorCode.InvalidExtension.ToCode().Should().Be("SLNX0002"); - ValidationErrorCode.NotATextFile.ToCode().Should().Be("SLNX0003"); - ValidationErrorCode.InvalidXml.ToCode().Should().Be("SLNX0010"); - ValidationErrorCode.ReferencedFileNotFound.ToCode().Should().Be("SLNX0011"); - ValidationErrorCode.InvalidWildcardUsage.ToCode().Should().Be("SLNX0012"); - ValidationErrorCode.XsdViolation.ToCode().Should().Be("SLNX0013"); + ValidationErrorCode.FileNotFound.ToCode().Should().Be("SLNX001"); + ValidationErrorCode.InvalidExtension.ToCode().Should().Be("SLNX002"); + ValidationErrorCode.NotATextFile.ToCode().Should().Be("SLNX003"); + ValidationErrorCode.InvalidXml.ToCode().Should().Be("SLNX010"); + ValidationErrorCode.ReferencedFileNotFound.ToCode().Should().Be("SLNX011"); + ValidationErrorCode.InvalidWildcardUsage.ToCode().Should().Be("SLNX012"); + ValidationErrorCode.XsdViolation.ToCode().Should().Be("SLNX013"); } }