MCPcopy Create free account
hub / github.com/MetaMask/rpc-errors / expectPullRequestTemplate

Function expectPullRequestTemplate

yarn.config.cjs:175–196  ·  view source on GitHub ↗

* Expect that the workspace has a pull_request_template.md file, and that it * is a non-empty string. The pull_request_template.md is expected to: * * - Not contain an examples section (unless the workspace is the module * template itself). * * @param {Workspace} workspace - The workspace to c

(workspace, workspaceName)

Source from the content-addressed store, hash-verified

173 * @returns {Promise<void>}
174 */
175async function expectPullRequestTemplate(workspace, workspaceName) {
176 if (workspaceName === 'metamask-module-template') {
177 return;
178 }
179
180 const pullRequestTemplate = await getWorkspaceFile(
181 workspace,
182 '.github/pull_request_template.md',
183 );
184
185 if (!pullRequestTemplate) {
186 workspace.error(
187 'The pull_request_template.md is missing. This should be added.',
188 );
189 }
190
191 if (pullRequestTemplate.includes('## Examples')) {
192 workspace.error(
193 'The pull_request_template.md contains an examples section. This section should be removed.',
194 );
195 }
196}
197
198/**
199 * Expect that the workspace has a valid `exports` field. The `exports` field

Callers 1

constraintsFunction · 0.85

Calls 1

getWorkspaceFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…