All files / src/rules _irule.ts

100% Statements 13/13
100% Branches 2/2
100% Functions 1/1
100% Lines 13/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54        1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x   1x                                                                      
import {IObject} from "../objects/_iobject";
import {Issue} from "../issue";
import {IRegistry} from "../_iregistry";
 
export enum RuleTag {
  Experimental = "Experimental",
  DeprecationCandidate = "DeprecationCandidate",
  Upport = "Upport",
  Downport = "Downport",
  Whitespace = "Whitespace",
  Naming = "Naming",
  Quickfix = "Quickfix",
  Performance = "Performance",
  Syntax = "Syntax",
  Security = "Security",
  /** Relevant wrt the official SAP ABAP style guide*/
  Styleguide = "Styleguide",
  /** Single file compatible, the rule gives correct results when having only information about the single file */
  SingleFile = "SingleFile",
}
 
/** Rule Metadata */
export interface IRuleMetadata {
  /** Rule key, no whitespace allowed, always lower case, words separated by underscore
   * Used in abaplint.json configuration files */
  key: string;
  /** Rule title */
  title: string;
  /** Short description in markdown, can be shown in editors */
  shortDescription: string;
  /** ABAP code with bad example, shown on rules.abaplint.org */
  badExample?: string;
  /** ABAP code with good example, shown on rules.abaplint.org */
  goodExample?: string;
  /** Extended information, markdown, only shown on rules.abaplint.org */
  extendedInformation?: string;
  /** Various tags with additional usage information */
  tags?: RuleTag[];
  /** Pragma that can be used to suppress the issue */
  pragma?: string;
  /** Pseudo comment that can be used to suppress the issue */
  pseudoComment?: string;
}
 
/** Rule Interface */
export interface IRule {
  getMetadata(): IRuleMetadata;
  getConfig(): void;
  setConfig(conf: any): void;
  /** called one time before run() */
  initialize(reg: IRegistry): IRule;
  /** called for each object */
  run(obj: IObject): readonly Issue[];
}