Reconcile vectors with main (two-pass merge: structural + cleanup)#64
Merged
matt-edmondson merged 245 commits intovectorsfrom May 9, 2026
Merged
Reconcile vectors with main (two-pass merge: structural + cleanup)#64matt-edmondson merged 245 commits intovectorsfrom
matt-edmondson merged 245 commits intovectorsfrom
Conversation
This commit includes the following changes: - Refactored project files to use the new SDK format, enhancing compatibility and maintainability. - Updated `global.json` to reflect the latest versions of `ktsu.Sdk` and `MSTest.Sdk`. - Removed outdated package versions from `Directory.Packages.props`, streamlining dependency management. - Enhanced GitHub Actions workflows to allow manual triggers and improved caching for SonarQube. - Updated unit tests to use `Assert.ThrowsExactly<TException>()` for more precise exception handling. These modifications aim to improve project organization, ensure up-to-date dependencies, and enhance testing reliability.
This commit includes the following changes: - Removed the `FluentValidation` dependency from various validation attributes, replacing it with a native validation approach. - Updated validation logic to return `ValidationResult` objects for success and failure cases. - Deleted the `FluentValidationAdapter` class and its associated tests, streamlining the validation framework. - Adjusted multiple validation attributes to ensure they function correctly without the FluentValidation integration. These modifications aim to simplify the validation framework and enhance maintainability by reducing external dependencies.
…on logic This commit includes the following changes: - Updated validation attributes to use constructor parameters for initialization, improving clarity and reducing boilerplate code. - Refactored validation logic to return `ValidationResult` objects directly, ensuring consistent success and failure handling. - Simplified the implementation of various validation adapters, including `ContainsValidator`, `EndsWithValidator`, and others, to streamline their functionality. These modifications aim to improve the maintainability and readability of the validation framework.
This commit includes the following changes: - Removed obsolete validation rules and README files related to the validation framework. - Introduced new path-related classes, including `SemanticAbsolutePath`, `SemanticDirectoryPath`, and `SemanticFilePath`, to enhance path handling capabilities. - Updated project files to reflect the new structure and added necessary interfaces for path validation. - Improved organization of validation attributes by moving them to a dedicated directory for better maintainability. These modifications aim to streamline the validation framework and enhance the overall path management functionality.
This commit introduces support for creating and manipulating semantic strings using read-only spans. Key changes include: - Added `FromReadOnlySpan` methods in `ISemanticStringFactory` and `SemanticStringFactory` for improved performance. - Updated `SemanticString` methods to utilize read-only spans for various operations, enhancing efficiency. - Refactored validation attributes to ensure compatibility with new span-based methods. These modifications aim to optimize string handling and validation processes within the framework.
This commit includes the following changes: - Added suppression warnings for specific code analysis rules related to string handling in the project file. - Simplified the `Remove` method in `SemanticString` by removing redundant parameter names for clarity. - Adjusted formatting for improved readability in the `MoveNext` method. These modifications aim to enhance code quality and maintainability within the string handling framework.
…operations This commit updates the `SemanticString` class to improve performance by using `WeakString` for various methods that handle read-only spans. Key changes include: - Modified `IndexOf`, `LastIndexOf`, `StartsWith`, `EndsWith`, and `Contains` methods to leverage `WeakString` instead of `AsSpan()`. - Added conditional compilation for span support based on target frameworks. These modifications aim to enhance efficiency in string operations while maintaining compatibility across different .NET versions.
This commit introduces a new polyfill for `ArgumentNullException.ThrowIfNull` to support older .NET versions. Additionally, it refactors the namespaces of various path-related classes and interfaces to `ktsu.Semantics.Paths` for improved organization and clarity. The changes include: - Added `ArgumentNullExceptionPolyfill` for null argument validation. - Updated namespaces in `SemanticAbsolutePath`, `SemanticDirectoryPath`, `SemanticFilePath`, `SemanticRelativePath`, and others to reflect the new structure. - Adjusted method implementations in path classes to utilize the new polyfill where applicable. These modifications aim to enhance code maintainability and ensure compatibility across different .NET versions.
…atibility This commit adds a polyfill for `ArgumentNullException.ThrowIfNull` to support older .NET versions across various path-related classes. Key changes include: - Integrated `ArgumentNullExceptionPolyfill` in `SemanticRelativePath`, `AbsoluteDirectoryPath`, `AbsoluteFilePath`, `DirectoryPath`, `RelativeDirectoryPath`, and `RelativeFilePath` implementations. - Updated null checks to utilize the polyfill for compatibility with .NET versions prior to 6.0. These modifications enhance the robustness of the path handling framework while ensuring backward compatibility.
…bility This commit updates the `AsRelative` method in the `RelativeFilePath` class to include a conditional compilation directive that utilizes `ArgumentNullExceptionPolyfill.ThrowIfNull` for .NET versions prior to 6.0. This change ensures consistent null argument validation across different framework versions, enhancing the robustness of the path handling implementation.
…tibility This commit introduces the `System.Memory` package for .NET Standard 2.0 support and adds several polyfills to enhance path handling across different .NET versions. Key changes include: - Added `System.Memory` package reference in `Directory.Packages.props` and project files for .NET Standard 2.0. - Implemented polyfills for `OperatingSystem` and `Path` methods to ensure compatibility with older .NET versions. - Updated various path-related classes to utilize the new polyfills, improving functionality and consistency in path operations. These modifications aim to enhance the robustness and compatibility of the path handling framework across different .NET versions.
…ation for older .NET versions This commit updates the `AbsoluteDirectoryPath`, `DirectoryPath`, and `RelativeDirectoryPath` classes to include synchronous `GetContents` methods for compatibility with .NET versions prior to 2.1. The changes ensure that directory contents can be enumerated synchronously when asynchronous methods are not available, enhancing the framework's robustness across different .NET versions. Additionally, minor adjustments were made to the `PooledStringBuilder` class for consistency in handling directory separators.
This commit makes minor formatting adjustments across several files to enhance code clarity. Changes include removing unnecessary blank lines and aligning code indentation for conditional compilation directives. These modifications aim to improve the overall maintainability of the path handling framework while ensuring consistent coding standards.
… clarity This commit updates the `SemanticDirectoryPath` class to rename the `Contents` property to `GetContents` for improved clarity. The method now consistently handles directory content retrieval, including error handling for access and existence checks. Additionally, the `GetContents` method is implemented synchronously across relevant directory path classes, ensuring compatibility with older .NET versions. Unused asynchronous method signatures have been removed from the `IDirectoryPath` interface to streamline the API.
…ysical dimensions and update test classes to static for consistency. This improves clarity and aligns with coding standards across the project.
…bute, and StartsWithAttribute classes This commit updates the validation logic in the `ContainsAttribute`, `EndsWithAttribute`, and `StartsWithAttribute` classes to return more informative error messages when the input value is null or empty. Instead of returning a success result, the validation now clearly indicates the expected substring, suffix, or prefix that must be present in the value, improving user feedback and clarity in validation errors.
This commit deletes several outdated files, including the derived cursor rules, .gitignore, and various history documents, to streamline the project and remove unnecessary clutter. The removal of these files helps maintain a cleaner codebase and improves overall project organization.
…ests for improved clarity
…hod naming and enhance error handling. The `Contents` property has been renamed to `GetContents` for clarity, and synchronous handling has been implemented to ensure compatibility with older .NET versions.
… improved performance and reliability. This change ensures that the regex operation does not hang indefinitely by setting a one-second timeout, enhancing the overall validation process.
This commit introduces two new test classes: `CasingAndContractsTests` and `RegexMatchAttributeTests`. The `CasingAndContractsTests` class validates camel case, pascal case, boolean, and contract strings, ensuring correct behavior for valid and invalid inputs. The `RegexMatchAttributeTests` class tests regex patterns for various string types, including handling invalid patterns and validating case insensitivity and multiline anchors. These additions enhance the test coverage for string semantics and validation logic.
This commit introduces two new test classes: `CasingValidatorsTests` and `LineCountValidatorsTests`. The `CasingValidatorsTests` class validates various casing formats, including upper case, lower case, title case, sentence case, snake case, kebab case, and macro case, ensuring correct behavior for valid and invalid inputs. The `LineCountValidatorsTests` class checks for exact, minimum, and maximum line counts in strings, enhancing the test coverage for string semantics and validation logic.
This commit introduces a new test class, `FirstClassAndFormatValidatorsTests`, which includes unit tests for multiple validators such as `IsDateTime`, `IsDecimal`, `IsDouble`, `IsGuid`, `IsInt32`, `IsIpAddress`, `IsTimeSpan`, `IsUri`, `IsVersion`, `HasNonWhitespaceContent`, `IsEmptyOrWhitespace`, `IsSingleLine`, and `IsMultiLine`. Each validator is tested for valid, invalid, and empty inputs, enhancing the test coverage for string semantics and validation logic.
This commit updates the Exposure class to use CoulombPerKilogram instead of Coulomb for exposure calculations. Additionally, new unit tests have been added for various nuclear quantities, including AbsorbedDose and EquivalentDose, to ensure correct conversions and calculations. The test suite now includes comprehensive checks for exposure-related functionalities, enhancing overall test coverage.
This commit adds the installation of the `dotnet-coverage` tool in the GitHub Actions workflow to facilitate code coverage collection during tests. It also updates the SonarQube scanner commands to improve coverage reporting and modifies the `Invoke-DotNetTest` function to utilize the new coverage tool. Additionally, the test project configuration is updated to show test failures and details, enhancing the overall testing and reporting capabilities.
--- updated-dependencies: - dependency-name: Polyfill dependency-version: 9.24.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bump Polyfill from 9.23.0 to 9.24.0
--- updated-dependencies: - dependency-name: Polyfill dependency-version: 10.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bump Polyfill from 9.24.0 to 10.0.0
--- updated-dependencies: - dependency-name: MSTest.Sdk dependency-version: 4.2.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bump MSTest.Sdk from 4.1.0 to 4.2.1
--- updated-dependencies: - dependency-name: Polyfill dependency-version: 10.1.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bump Polyfill from 10.0.0 to 10.1.1
--- updated-dependencies: - dependency-name: Polyfill dependency-version: 10.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bump Polyfill from 10.1.1 to 10.3.0
--- updated-dependencies: - dependency-name: MSTest.Sdk dependency-version: 4.2.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bump MSTest.Sdk from 4.2.1 to 4.2.2
--- updated-dependencies: - dependency-name: Polyfill dependency-version: 10.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bump Polyfill from 10.3.0 to 10.4.0
--- updated-dependencies: - dependency-name: Polyfill dependency-version: 10.5.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bump Polyfill from 10.4.0 to 10.5.0
Reconcile vectors with main's parallel evolution. Resolution rules:
- Quantities: take vectors. dimensions.json + source generator is the
intended end state; main's per-domain folder reorg of soon-to-be-deleted
hand-written types is dropped (110 conflicts).
- Path types: take main's flat layout (Semantics.Paths/{Implementations,
Interfaces,Primitives}/...) instead of vectors' doubled
Semantics.Paths/Paths/... (~50 conflicts via rename/rename).
- Path utility: take main's conditional-compilation PathPolyfill pattern;
drop vectors' PathHelper duplicate (Utilities/NetStandard20Polyfills.cs).
- Validation: take vectors' attribute-per-file reorganisation under
Semantics.Strings/Validation/Attributes/{Casing,Format,FirstClassTypes,
Text}/ and Semantics.Paths/Validation/Attributes/Path/.
- scripts/: take vectors' deletion (build moved to ktsu MSBuild SDKs).
- Tests: take vectors where it adds coverage; take main where it improved
assertion messages (PathUtilityTests).
- Solution: take vectors (only it includes Semantics.SourceGenerators).
- csproj files: take vectors (reflect new package layout, including
InternalsVisibleTo and Microsoft.Bcl.AsyncInterfaces conditional refs).
- Directory.Packages.props: merge — keep vectors' source-generator deps
(CodeBlocker, Microsoft.CodeAnalysis.*, System.Text.Json, PreciseNumber,
Microsoft.Bcl.AsyncInterfaces) plus main's bumped versions
(Polyfill 10.5.0) and added packages (ktsu.RoundTripStringJsonConverter).
- global.json: take main's MSTest.Sdk 4.2.2.
This is pass 1 of the two-pass reconciliation. Pass 2 audits the
substantive main commits (RoundTripStringJsonConverter integration,
Ensure.NotNull replacement of Guard, DirectoryName type, .NET 10 / SDK
adjustments) to ensure their content is applied where the resolution
rules took vectors' file.
…types The structural merge brought in test files from main that reference hand-written quantity classes which vectors deleted in favour of generated types. Remove them so the tree compiles; equivalent coverage against generated types is tracked in issue #54. Removed: - AcousticImpedanceTests.cs (FromRayls / FromPascalSecondsPerMeter / etc. not emitted by QuantitiesGenerator; per #48 only the SI base-unit factory is generated). - AcousticDirectionalityIndexTests.cs (DirectionalityIndex type was hand-written; not in dimensions.json). - ReflectionCoefficientTests.cs (ReflectionCoefficient and SoundAbsorption were hand-written; not in dimensions.json). - SoundSpeedTests.cs (FromFeetPerSecond not emitted; static Multiply method not generated). - NuclearQuantitiesTests.cs (FromGrays / FromMicrograys / FromRads / FromEnergyAndMass / FromMicrosieverts / Energy.FromJoules — none of these factory names are emitted). - PhysicalDimensionTests.cs (uses BootstrapUnits.Meter and the old PhysicalDimension(baseUnit:, length:, time:) constructor; both removed). - PhysicalDimensionExtensionsTests.cs (uses 1.0.Meters() / 1.0.Kilograms() extension methods that don't exist in the generator output). - UnitExtensionsAndExceptionTests.cs (uses Units.Meter as an enum-like value with IsBaseUnit / IsSI / IsMetric / IsImperial extensions; vectors emits Units as a namespace of per-unit structs). Also add ktsu.RoundTripStringJsonConverter PackageReference to Semantics.Strings.csproj so SemanticString.cs's [JsonConverter(typeof(RoundTripStringJsonConverterFactory))] resolves.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Reconciles the
vectorsbranch withmain's parallel evolution. This is the actual content of what PR #63 was trying to do, but resolved with a coherent strategy.The approach was the agreed two-pass plan:
Pass 1 — structural merge (commit
cff3b99)git merge origin/mainproduced 212 unmerged paths. Resolved as follows:Semantics.Paths/Paths/...vsSemantics.Paths/...)scripts/(vectors deleted, main updated)Directory.Packages.props(UU)Polyfills.csvsUtilities/NetStandard20Polyfills.csPathPolyfillpattern; deleted vectors'PathHelper.After resolving, fixed up several files that still had embedded conflict markers from
git's rename/rename detection (path types using the oldPathHelper.Xcalls).Pass 2 — audit and clean up (commit
20b4460)Tracked through the substantive main changes that could have been buried by the "take vectors" rule and verified they came across:
RoundTripStringJsonConverterintegration — verifiedusingand[JsonConverter(...)]are inSemanticString.cs; added the missing<PackageReference Include="ktsu.RoundTripStringJsonConverter" />toSemantics.Strings.csproj.Ensure.NotNullreplacement ofGuard— vectors already used the same pattern; noArgumentNullException.ThrowIfNullleft in source.DirectoryNametype +IDirectoryName+IsDirectoryNameAttribute— all came across in the merge..NET 10upgrade — already in vectors.System.Memory4.6.3 — already in vectors.Then deleted 8 test files imported from main that reference quantity types vectors removed (
AcousticImpedance's hand-written factories,DirectionalityIndex,ReflectionCoefficient,SoundAbsorption,BootstrapUnits, theUnitsenum-like accessor withIsBaseUnit()/IsSI()extensions,1.0.Meters()extension methods, etc.). The point of those tests is fine — they should be re-added against the generated types — but that work belongs in #54.Net diff
vectors(38 commits, branched atfaf299fa) now sits on top of all 243 main commits. PR #63 (which was attempting the same reconciliation but with merge conflicts) becomes redundant once this lands.Test plan
Semantics.Quantities/Generated/as onvectors.Semantics.Strings/SemanticString.csresolvesRoundTripStringJsonConverterFactoryafter the new package reference.AcousticOperatorTests,PhysicalQuantityCoreTests,CasingValidatorsTests,FirstClassAndFormatValidatorsTests,LineCountValidatorsTests,RegexMatchAttributeTests,DirectoryNameTests,PathIntegrationTests,RelativePathPropertyTests) reference any removed types.Follow-ups (deferred, tracked separately)
Polyfills.cs(kept, main's) andUtilities/NetStandard20Polyfills.cs(deleted, vectors') had overlapping helpers — confirm no hidden references to the deleted file remain after the merge once CI runs.vectorsso the doc work merges in alongside this reconciliation.🤖 Generated by Claude Code per the locked design decisions discussed in this branch.
Generated by Claude Code