CodeOwnersParseError Struct

Describes why a CODEOWNERS file is invalid, and where.

var isValid = CodeOwnersFile.TryParse("[Section\n* @user1", CodeOwnersDialect.GitLab, out var file, out var error);

Assert.False(isValid);
Assert.Null(file);
Assert.Equal(CodeOwnersParseErrorKind.UnterminatedSectionHeader, error.Kind);
Assert.Equal(1, error.LineNumber);
Assert.Equal(1, error.LinePosition);
public readonly struct CodeOwnersParseError : IEquatable<CodeOwnersParseError>
Implements

Properties

NameDescription
KindGets the kind of error.
LineNumberGets the one-based number of the line containing the error, or 0 when the position is unknown.
LinePositionGets the one-based position of the error within its line, or 0 when the position is unknown.

Gets the kind of error.

public CodeOwnersParseErrorKind Kind { get; }

Gets the one-based number of the line containing the error, or 0 when the position is unknown.

public int LineNumber { get; }

Property value

int

Gets the one-based position of the error within its line, or 0 when the position is unknown.

public int LinePosition { get; }

Property value

int

Methods

NameDescription
Equals(CodeOwnersParseError)
Equals(object?)
GetHashCode()
ToString()Returns a description of the error and of its location.

Equals overloads

Equals(CodeOwnersParseError)

CodeOwnersParseError.cs
public bool Equals(CodeOwnersParseError other)
Parameters
other CodeOwnersParseError
Returns

bool

No documentation is available.

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

public override int GetHashCode()

Returns

int

No documentation is available.

Returns a description of the error and of its location.

public override string ToString()

Returns

string

Operators

NameDescription
operator ==(CodeOwnersParseError, CodeOwnersParseError)
operator !=(CodeOwnersParseError, CodeOwnersParseError)

operator ==(CodeOwnersParseError, CodeOwnersParseError)

CodeOwnersParseError.cs
public static bool operator ==(CodeOwnersParseError left, CodeOwnersParseError right)

No documentation is available.

operator !=(CodeOwnersParseError, CodeOwnersParseError)

CodeOwnersParseError.cs
public static bool operator !=(CodeOwnersParseError left, CodeOwnersParseError right)

No documentation is available.