prDescription.ts 676 B

12345678910111213141516171819
  1. import { DangerDSLType, DangerResults } from "danger";
  2. declare const danger: DangerDSLType;
  3. declare const warn: (message: string, results?: DangerResults) => void;
  4. /**
  5. * Check if pull request has has a sufficiently accurate description
  6. *
  7. * @dangerjs WARN
  8. */
  9. export default function (): void {
  10. const prDescription: string = danger.github.pr.body;
  11. const shortPrDescriptionThreshold: number = 100; // Description is considered too short below this number of characters
  12. if (prDescription.length < shortPrDescriptionThreshold) {
  13. return warn(
  14. "The PR description looks very brief, please check if more details can be added."
  15. );
  16. }
  17. }