Skip to content

Commit 02ae03d

Browse files
minor edits of doc comments
1 parent 3231500 commit 02ae03d

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

Semver/IntExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ public static int Digits(this int n)
2020
{
2121
if (n < 10) return 1;
2222
if (n < 100) return 2;
23-
if (n < 1000) return 3;
24-
if (n < 10000) return 4;
25-
if (n < 100000) return 5;
26-
if (n < 1000000) return 6;
27-
if (n < 10000000) return 7;
28-
if (n < 100000000) return 8;
29-
if (n < 1000000000) return 9;
23+
if (n < 1_000) return 3;
24+
if (n < 10_000) return 4;
25+
if (n < 100_000) return 5;
26+
if (n < 1_000_000) return 6;
27+
if (n < 10_000_000) return 7;
28+
if (n < 100_000_000) return 8;
29+
if (n < 1_000_000_000) return 9;
3030
return 10;
3131
}
3232
}

Semver/SemVersion.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ public SemVersion(Version version)
9999
/// Converts the string representation of a semantic version to its <see cref="SemVersion"/> equivalent.
100100
/// </summary>
101101
/// <param name="version">The version string.</param>
102-
/// <param name="strict">If set to <see langword="true"/> minor and patch version are required.
102+
/// <param name="strict">If set to <see langword="true"/> minor and patch version are required,
103103
/// otherwise they are optional.</param>
104104
/// <returns>The <see cref="SemVersion"/> object.</returns>
105105
/// <exception cref="ArgumentNullException">The <paramref name="version"/> is <see langword="null"/>.</exception>
106-
/// <exception cref="ArgumentException">The version number has an invalid format.</exception>
107-
/// <exception cref="InvalidOperationException">The version number is missing Minor or Patch versions when they are required.</exception>
106+
/// <exception cref="ArgumentException">The <paramref name="version"/> has an invalid format.</exception>
107+
/// <exception cref="InvalidOperationException">The <paramref name="version"/> is missing Minor or Patch versions and <paramref name="strict"/> is <see langword="true"/>.</exception>
108108
/// <exception cref="OverflowException">The Major, Minor, or Patch versions are larger than <code>int.MaxValue</code>.</exception>
109109
public static SemVersion Parse(string version, bool strict = false)
110110
{
@@ -142,7 +142,7 @@ public static SemVersion Parse(string version, bool strict = false)
142142
/// <param name="semver">When the method returns, contains a <see cref="SemVersion"/> instance equivalent
143143
/// to the version string passed in, if the version string was valid, or <see langword="null"/> if the
144144
/// version string was not valid.</param>
145-
/// <param name="strict">If set to <see langword="true"/> minor and patch version are required.
145+
/// <param name="strict">If set to <see langword="true"/> minor and patch version are required,
146146
/// otherwise they are optional.</param>
147147
/// <returns><see langword="false"/> when a invalid version string is passed, otherwise <see langword="true"/>.</returns>
148148
public static bool TryParse(string version, out SemVersion semver, bool strict = false)
@@ -186,7 +186,7 @@ public static bool TryParse(string version, out SemVersion semver, bool strict =
186186
/// </summary>
187187
/// <param name="versionA">The first version to compare.</param>
188188
/// <param name="versionB">The second version to compare.</param>
189-
/// <returns><see langword="true"/> if the two values are equal; otherwise, <see langword="false"/>.</returns>
189+
/// <returns><see langword="true"/> if the two values are equal, otherwise <see langword="false"/>.</returns>
190190
public static bool Equals(SemVersion versionA, SemVersion versionB)
191191
{
192192
if (ReferenceEquals(versionA, versionB)) return true;
@@ -199,7 +199,7 @@ public static bool Equals(SemVersion versionA, SemVersion versionB)
199199
/// </summary>
200200
/// <param name="versionA">The first version to compare.</param>
201201
/// <param name="versionB">The second version to compare.</param>
202-
/// <returns>A signed number indicating the relative values of <code>versionA</code> and <code>versionB</code>.</returns>
202+
/// <returns>A signed number indicating the relative values of <paramref name="versionA"/> and <paramref name="versionB"/>.</returns>
203203
public static int Compare(SemVersion versionA, SemVersion versionB)
204204
{
205205
if (ReferenceEquals(versionA, versionB)) return 0;
@@ -218,9 +218,13 @@ public static int Compare(SemVersion versionA, SemVersion versionB)
218218
/// <param name="build">The value to replace the build metadata or <see langword="null"/> to leave it unchanged.</param>
219219
/// <returns>The new version object.</returns>
220220
/// <remarks>
221-
/// The change method is intended to be called using named argument syntax.
222-
/// For example, to change the patch version, use <code>version.Change(patch: 4)</code>.
221+
/// The change method is intended to be called using named argument syntax, passing only
222+
/// those fields to be changed.
223223
/// </remarks>
224+
/// <example>
225+
/// To change only the patch version:
226+
/// <code>version.Change(patch: 4)</code>
227+
/// </example>
224228
public SemVersion Change(int? major = null, int? minor = null, int? patch = null,
225229
string prerelease = null, string build = null)
226230
{
@@ -433,7 +437,7 @@ private static int CompareComponent(string a, string b, bool nonemptyIsLower = f
433437
/// </summary>
434438
/// <param name="obj">The <see cref="object" /> to compare with this instance.</param>
435439
/// <returns>
436-
/// <see langword="true"/> if the specified <see cref="object" /> is equal to this instance; otherwise, <see langword="false"/>.
440+
/// <see langword="true"/> if the specified <see cref="object" /> is equal to this instance, otherwise <see langword="false"/>.
437441
/// </returns>
438442
/// <exception cref="InvalidCastException">The <paramref name="obj"/> is not a <see cref="SemVersion"/>.</exception>
439443
public override bool Equals(object obj)

0 commit comments

Comments
 (0)