website refactor
This commit is contained in:
25
apps/website/tests/guardrails/GuardrailViolation.ts
Normal file
25
apps/website/tests/guardrails/GuardrailViolation.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Guardrail violation representation
|
||||
*/
|
||||
|
||||
export class GuardrailViolation {
|
||||
constructor(
|
||||
public readonly ruleName: string,
|
||||
public readonly filePath: string,
|
||||
public readonly lineNumber: number,
|
||||
public readonly description: string,
|
||||
) {}
|
||||
|
||||
toString(): string {
|
||||
return `${this.filePath}:${this.lineNumber} - ${this.ruleName}: ${this.description}`;
|
||||
}
|
||||
|
||||
toJSON(): object {
|
||||
return {
|
||||
rule: this.ruleName,
|
||||
file: this.filePath,
|
||||
line: this.lineNumber,
|
||||
description: this.description,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user