Skip to content

Commit e33bef3

Browse files
authored
More doc updates
* Corrected typos in general * Clarified AppContextSwithches use and eliminated mention of framework specific support. - Behavior and functionality is outside the scope of this project anyway.
1 parent 1570d92 commit e33bef3

File tree

3 files changed

+24
-26
lines changed

3 files changed

+24
-26
lines changed

docfx/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ while conforming to the syntax of CSemVer and CSemVer-CI
1414
> There is confusion on the ordering of a CI build with relation to a release build with
1515
> CSemVer-CI. A CI Build is either an initial build of an unreleased version with
1616
> [Major.Minor.Patch] == [0.0.0]. Or, it is based on the previously released version and
17-
is [Major.Minor.Patch+1]. That is, a CI build is ordered BEFORE all release builds, or it
18-
> is ordered AFTER the specific release it is based on! In particular a CI build version
19-
> does ***NOT*** indicate what it will become when it is finally released, but what
20-
> release it was based on (If any). To simplify that, for clarity, a CI build contains
21-
> everything in the release it was based on and additional changes (that might remove
22-
> things). CI builds are, by definition NOT stable and consumers cannot rely on them for
23-
> predictions of future stability. A given CI build may even represent an abandoned
24-
> approach that never becomes a release!
17+
> is [Major.Minor.Patch+1]. That is, a CI build is ordered ***BEFORE*** all release builds,
18+
> or it is ordered ***AFTER*** the ***specific*** release it is based on! In particular a
19+
> CI build version does ***NOT*** indicate what it will become when it is finally released,
20+
> but what release it was based on (If any). To simplify that, for clarity, a CI build
21+
> contains everything in the release it was based on and additional changes (that might
22+
> remove things). CI builds are, by definition NOT stable and consumers cannot rely on
23+
> them for predictions of future stability. A given CI build may even represent an
24+
> abandoned approach that never becomes a release!
2525
2626
---
2727
[Attributions](Attributions.md)

src/Ubiquity.NET.Versioning/AppContextSwitches.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,12 @@ public const string CSemVerCIOnlySupportsBuildMetaOnZeroTimedVersionsName
4949
/// <para>The spec is vague on the precise syntax of a CSemVer-CI value and whether a given form can include build meta data.
5050
/// It is at least explicitly allowed for ZeroTimed base values. But it is unclear if it is supposed to be allowed
5151
/// for any "latest release" forms. Sadly, .NET builds using SourceLink will automatically add the build meta if not present
52-
/// so this implementation choses to assume that is legit. This seems reasonable as the build meta doesn't participate
53-
/// in the ordering of version values and is syntactically compatible with both forms of CSemVer-CI. That is the default behavior
52+
/// so this implementation chooses to assume that is legit. This seems reasonable as the build meta doesn't participate
53+
/// in the ordering of version values and is syntactically compatible with both forms of CSemVer-CI. That is, the default behavior
5454
/// of allowing it has low risk of causing problems, but the reverse can.</para>
5555
/// <para>As with all <see cref="AppContext"/> switches the default state of this switch is OFF. Setting it ON, is a manual operation
5656
/// that may use one of the standard mechanisms supported by <see cref="AppContext"/> using this name. Or, programmatically via the
5757
/// <see cref="CSemVerCIOnlySupportsBuildMetaOnZeroTimedVersions"/>.</para>
58-
/// <para>For `app.config` and other <see cref="AppContext"/> uses, the name is formally documented as
59-
/// "Ubiquity.NET.Versioning.AppContextSwitches.CSemVerCIOnlySupportsBuildMetaOnZeroTimedVersions".
60-
/// </para>
6158
/// </remarks>
6259
public static bool CSemVerCIOnlySupportsBuildMetaOnZeroTimedVersions
6360
{

src/Ubiquity.NET.Versioning/CSemVer.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ public readonly struct CSemVer
3030
/// <param name="minor">Minor version value [0-49999]</param>
3131
/// <param name="patch">Patch version value [0-9999]</param>
3232
/// <param name="preRelVersion">Pre-release version information (if a pre-release build)</param>
33-
/// <param name="buildMetaData">[Optional]Additional build meta data [default: empty string]</param>
34-
/// <remarks>
35-
/// This is used internally when converting from a File Version as those only have a single bit
36-
/// to indicate if they are a Release/CI build. The rest of the information is lost and therefore
37-
/// does not participate in ordering.
38-
/// </remarks>
33+
/// <param name="buildMetaData">Any additional build meta data [default: empty string]</param>
3934
public CSemVer( int major
4035
, int minor
4136
, int patch
@@ -77,8 +72,10 @@ public CSemVer( int major
7772
/// <summary>Gets the <see cref="FileVersionQuad"/> representation of this <see cref="CSemVer"/></summary>
7873
/// <remarks>
7974
/// Since a <see cref="FileVersionQuad"/> is entirely numeric the conversion is somewhat "lossy" but does
80-
/// NOT lose any relation to other versions converted. That, is the loss does not include any information
81-
/// that impacts build version sort ordering. (any data lost is ignored for sort ordering anyway)
75+
/// NOT lose any relation to other released versions converted. That, is the loss does not include any CI
76+
/// information, only that it was a CI build. Two CI builds with the same base version will produce the
77+
/// same value! CI builds are not intended for long term stability and this is not a bug but a design of
78+
/// how CSemVer (and CSemVer-CI) work to produce a <see cref="FileVersionQuad"/>.
8279
/// </remarks>
8380
public FileVersionQuad FileVersion
8481
{
@@ -119,7 +116,8 @@ public ulong OrderedVersion
119116
/// <summary>Gets a value indicating whether this is a zero based version</summary>
120117
public bool IsZero => Major == 0 && Minor == 0 && Patch == 0;
121118

122-
/// <inheritdoc/>
119+
/// <summary>Converts the internal representation of this version to a valid CSemVer formatted string</summary>
120+
/// <returns>CSemVer formatted string</returns>
123121
public override string ToString( )
124122
{
125123
return ConstrainedVersion?.ToString() ?? string.Empty;
@@ -183,9 +181,9 @@ public override int GetHashCode( )
183181
/// <returns><see langword="true"/> if the conversion is performed or <see langword="false"/> if not (<paramref name="reason"/> will hold reason it is not successful)</returns>
184182
/// <remarks>
185183
/// While EVERY <see cref="CSemVer"/> conforms to valid <see cref="SemVer"/> the reverse is not always true.
186-
/// This method attempts to make a conversion using the classic try pattern with the inclusion of a string
184+
/// This method attempts to make a conversion using the classic try pattern with the inclusion of an exception
187185
/// that explains the reason for any failures. This is useful in debugging or for creating wrappers that will
188-
/// throw an exception.
186+
/// throw the exception.
189187
/// </remarks>
190188
public static bool TryFrom(
191189
SemVer ver,
@@ -273,7 +271,7 @@ public static CSemVer From( UInt64 fileVersion, IReadOnlyCollection<string>? bui
273271
/// <summary>Converts a CSemVer ordered version integral value (UInt64) into a full <see cref="CSemVer"/></summary>
274272
/// <param name="orderedVersion">The ordered version value</param>
275273
/// <param name="buildMetaData">Optional build meta data value for the version</param>
276-
/// <returns><see cref="CSemVer"/> corresponding to the ordered version number provided</returns>
274+
/// <returns>Version corresponding to the ordered version number provided</returns>
277275
public static CSemVer FromOrderedVersion( UInt64 orderedVersion, IReadOnlyCollection<string>? buildMetaData = null )
278276
{
279277
buildMetaData ??= [];
@@ -314,7 +312,7 @@ public static CSemVer FromOrderedVersion( UInt64 orderedVersion, IReadOnlyCollec
314312
/// <summary>Factory method to create a <see cref="CSemVer"/> from information available as part of a build</summary>
315313
/// <param name="buildVersionXmlPath">Path to the BuildVersion XML data for the repository</param>
316314
/// <param name="buildMeta">Additional Build meta data for the build</param>
317-
/// <returns><see cref="CSemVer"/></returns>
315+
/// <returns>Version information parsed from the build XML</returns>
318316
public static CSemVer From( string buildVersionXmlPath, IReadOnlyCollection<string>? buildMeta )
319317
{
320318
var parsedBuildVersionXml = ParsedBuildVersionXml.ParseFile( buildVersionXmlPath );
@@ -343,6 +341,9 @@ public static CSemVer Parse( string s, IFormatProvider? provider )
343341
}
344342

345343
/// <inheritdoc/>
344+
/// <remarks>
345+
/// <paramref name="provider"/> is ALWAYS ignored by this implementation. The format is defined by the spec and independent of culture.
346+
/// </remarks>
346347
public static bool TryParse( [NotNullWhen( true )] string? s, IFormatProvider? provider, [MaybeNullWhen( false )] out CSemVer result )
347348
{
348349
return TryParse(s, out result, out _);

0 commit comments

Comments
 (0)