|
| 1 | +export interface PrRule { |
| 2 | + id: string; |
| 3 | + rule: string; |
| 4 | + hint: string; |
| 5 | + /** If the user's change description contains any of these keywords, flag the rule as "warn". */ |
| 6 | + warnKeywords?: string[]; |
| 7 | +} |
| 8 | + |
| 9 | +export const prRules: PrRule[] = [ |
| 10 | + { |
| 11 | + id: "changelog", |
| 12 | + rule: "Updated CHANGELOG.md as part of the PR", |
| 13 | + hint: "Add an entry under the current version in CHANGELOG.md describing your user-visible change. Follow the existing tense and category style (Features / Improvements / Bug Fixes)." |
| 14 | + }, |
| 15 | + { |
| 16 | + id: "naming-convention", |
| 17 | + rule: "New variables use lowerCamelCase, not snake_case", |
| 18 | + hint: "snake_case was used historically but is being phased out. All new variables must use lowerCamelCase." |
| 19 | + }, |
| 20 | + { |
| 21 | + id: "yarn-lock-unchanged", |
| 22 | + rule: "yarn.lock was NOT modified and NOT committed", |
| 23 | + hint: "If you deleted .npmrc for local dev, yarn.lock may have changed. Revert it before committing: git checkout yarn.lock" |
| 24 | + }, |
| 25 | + { |
| 26 | + id: "npmrc-unchanged", |
| 27 | + rule: ".npmrc was NOT committed", |
| 28 | + hint: "The .npmrc file points to an Azure Artifacts feed and must not be modified or deleted in your PR." |
| 29 | + }, |
| 30 | + { |
| 31 | + id: "lint-passes", |
| 32 | + rule: "yarn run lint was run and passes", |
| 33 | + hint: "Run 'yarn run lint' locally and fix all warnings and errors before submitting your PR." |
| 34 | + }, |
| 35 | + { |
| 36 | + id: "coding-guidelines", |
| 37 | + rule: "TypeScript coding guidelines followed", |
| 38 | + hint: "Follow the TypeScript coding guidelines: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines. Code is formatted using the default TypeScript formatter in VS Code with 4-space indentation." |
| 39 | + }, |
| 40 | + { |
| 41 | + id: "dependency-changes", |
| 42 | + rule: "If package.json dependencies were added or changed, the team was pinged in the PR", |
| 43 | + hint: "Dependency changes require intervention from the CMake Tools team because the repo uses an Azure Artifacts feed. Mention @microsoft/vscode-cmake-tools in the PR.", |
| 44 | + warnKeywords: ["package.json", "dependency", "dependencies", "npm install", "yarn add", "added a package", "updated a package", "new dependency"] |
| 45 | + } |
| 46 | +]; |
0 commit comments