Skip to content

Commit d989f48

Browse files
Change error codes from 4-digit to 3-digit format (SLNX0011 -> SLNX011)
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
1 parent 18c9256 commit d989f48

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ slnx-validator MySolution.slnx
7171
[FAIL] MySolution.slnx
7272
7373
MySolution.slnx
74-
- line 5: [SLNX0013] The element 'Folder' in namespace '...' has invalid child element 'Folder'. List of possible elements expected: 'Project'.
75-
- line 12: [SLNX0011] File not found: docs\CONTRIBUTING.md
74+
- line 5: [SLNX013] The element 'Folder' in namespace '...' has invalid child element 'Folder'. List of possible elements expected: 'Project'.
75+
- line 12: [SLNX011] File not found: docs\CONTRIBUTING.md
7676
```
7777

7878
### Multiple files — mixed results
@@ -86,8 +86,8 @@ slnx-validator src\
8686
[FAIL] src\Backend.slnx
8787
8888
src\Backend.slnx
89-
- line 4: [SLNX0011] File not found: docs\CONTRIBUTING.md
90-
- line 8: [SLNX0012] Wildcard patterns are not supported in file paths: docs\*.md
89+
- line 4: [SLNX011] File not found: docs\CONTRIBUTING.md
90+
- line 8: [SLNX012] Wildcard patterns are not supported in file paths: docs\*.md
9191
```
9292

9393
## What is validated
@@ -116,13 +116,13 @@ The following are **intentionally out of scope** because the toolchain already h
116116

117117
| Code | Name | Description |
118118
|------|------|-------------|
119-
| `SLNX0001` | `FileNotFound` | The input `.slnx` file does not exist. |
120-
| `SLNX0002` | `InvalidExtension` | The input file does not have a `.slnx` extension. |
121-
| `SLNX0003` | `NotATextFile` | The file is binary and cannot be parsed as XML. |
122-
| `SLNX0010` | `InvalidXml` | The file is not valid XML (see [`examples/invalid-not-xml.slnx`](examples/invalid-not-xml.slnx)). |
123-
| `SLNX0011` | `FileNotFound` | A file referenced in `<File Path="...">` does not exist on disk. |
124-
| `SLNX0012` | `InvalidWildcardUsage` | A `<File Path="...">` contains a wildcard pattern (see [`examples/invalid-wildcard.slnx`](examples/invalid-wildcard.slnx)). |
125-
| `SLNX0013` | `XsdViolation` | The XML structure violates the schema, e.g. `<Folder>` inside `<Folder>` (see [`examples/invalid-xsd.slnx`](examples/invalid-xsd.slnx)). |
119+
| `SLNX001` | `FileNotFound` | The input `.slnx` file does not exist. |
120+
| `SLNX002` | `InvalidExtension` | The input file does not have a `.slnx` extension. |
121+
| `SLNX003` | `NotATextFile` | The file is binary and cannot be parsed as XML. |
122+
| `SLNX010` | `InvalidXml` | The file is not valid XML (see [`examples/invalid-not-xml.slnx`](examples/invalid-not-xml.slnx)). |
123+
| `SLNX011` | `ReferencedFileNotFound` | A file referenced in `<File Path="...">` does not exist on disk. |
124+
| `SLNX012` | `InvalidWildcardUsage` | A `<File Path="...">` contains a wildcard pattern (see [`examples/invalid-wildcard.slnx`](examples/invalid-wildcard.slnx)). |
125+
| `SLNX013` | `XsdViolation` | The XML structure violates the schema, e.g. `<Folder>` inside `<Folder>` (see [`examples/invalid-xsd.slnx`](examples/invalid-xsd.slnx)). |
126126

127127
## XSD Schema
128128

src/SLNX-validator.Core/ValidationResults/ValidationErrorCodeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ namespace JulianVerdurmen.SlnxValidator.Core.ValidationResults;
33
public static class ValidationErrorCodeExtensions
44
{
55
public static string ToCode(this ValidationErrorCode code) =>
6-
$"SLNX{(int)code:D4}";
6+
$"SLNX{(int)code:D3}";
77
}

tests/SLNX-validator.Core.Tests/SlnxValidatorTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ public async Task ValidateAsync_WildcardInFilePath_ReturnsInvalidWildcardUsageEr
146146
[Test]
147147
public async Task ValidationErrorCode_ToCode_ReturnsPrefixedCode()
148148
{
149-
ValidationErrorCode.FileNotFound.ToCode().Should().Be("SLNX0001");
150-
ValidationErrorCode.InvalidExtension.ToCode().Should().Be("SLNX0002");
151-
ValidationErrorCode.NotATextFile.ToCode().Should().Be("SLNX0003");
152-
ValidationErrorCode.InvalidXml.ToCode().Should().Be("SLNX0010");
153-
ValidationErrorCode.ReferencedFileNotFound.ToCode().Should().Be("SLNX0011");
154-
ValidationErrorCode.InvalidWildcardUsage.ToCode().Should().Be("SLNX0012");
155-
ValidationErrorCode.XsdViolation.ToCode().Should().Be("SLNX0013");
149+
ValidationErrorCode.FileNotFound.ToCode().Should().Be("SLNX001");
150+
ValidationErrorCode.InvalidExtension.ToCode().Should().Be("SLNX002");
151+
ValidationErrorCode.NotATextFile.ToCode().Should().Be("SLNX003");
152+
ValidationErrorCode.InvalidXml.ToCode().Should().Be("SLNX010");
153+
ValidationErrorCode.ReferencedFileNotFound.ToCode().Should().Be("SLNX011");
154+
ValidationErrorCode.InvalidWildcardUsage.ToCode().Should().Be("SLNX012");
155+
ValidationErrorCode.XsdViolation.ToCode().Should().Be("SLNX013");
156156
}
157157
}

0 commit comments

Comments
 (0)