Docs/CI

Code Annotations

Annotations build on the Pierre CI service to list out identified issues found in a branch and optionally attach markers to specific lines across the codebase.

Example

Annotations allow you to attach markers to the top level of a branch, or to specific lines in files. This can be useful for flagging linter issues, type failures, todos, or even attaching build artifacts.

How it works

Import and provide the following properties to the annotation method.

import { annotate } from 'pierre';

export default async () => {
  annotate({
    icon: Icons.CIFailed,
    color: 'red',
    filename: filepath,
    line: parseInt(lineNo),
    label: 'Typescript failure',
    description: `${errorMessage} (${errorCode})`,
  });
};
export interface Annotation {
  // Themeable color
  color?: Color;

  // visual icon
  icon?: Icons;

  // title for an annotation
  label?: string;

  // description of the annotaiton
  description?: string;

  // optional filename if attaching to a file
  filename?: string;

  //  optional line number if attaching to a file
  line?: number;

  // link to external asset
  href?: string;
}

Icon and colors come from the Pierre design system. While not open sourced, you can use any color or icon from the system by name.

Joyful code review

Pierre wants you to enjoy your code reviews. So, we built a ~*~NEW~*~ git platform. Join the waitlist to get early access.

Orrr… skip the line! Join our Discord for early access