ValeViolationPosition

The ValeViolationPosition class does something.

Definition

Source Code

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

class ValeViolationPosition {
    [System.IO.FileInfo]$FileInfo
    [int]$Line
    [int]$StartColumn
    [int]$EndColumn

    [string] ToString() {
        if ($null -ne $this.FileInfo) {
            return @(
                @(
                    $this.FileInfo.FullName
                    $this.Line
                    $this.StartColumn
                ) -join ':'
                $this.EndColumn
            ) -join '-'
        }

        return @(
            @(
                $this.Line
                $this.StartColumn
            ) -join ':'
            $this.EndColumn
        ) -join '-'
    }

    [string] ToRelativeString() {
        if ($null -ne $this.FileInfo) {
            return @(
                @(
                    (Resolve-Path -Path $this.FileInfo.FullName -Relative)
                    $this.Line
                    $this.StartColumn
                ) -join ':'
                $this.EndColumn
            ) -join '-'
        }

        return @(
            @(
                $this.Line
                $this.StartColumn
            ) -join ':'
            $this.EndColumn
        ) -join '-'
    }
}

An instance of the ValeViolationPosition class does something.

Examples

This example demonstrates something.

This example demonstrates something.

Constructors

ValeViolationPosition()
Initializes a new instance of the ValeViolationPosition class.

Methods

Properties

Last modified March 10, 2023: (GH-71) Document Vale classes (ad1e42a)