Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if ( ! whitelistedPath ) {
notWhitelistedFiles.push( file );
}
} );
if ( notWhitelistedFiles.length > 0 ) {
const stringifiedFilesList = '\n' + notWhitelistedFiles.join( '\n' );
warn(
'Consider adding new PHP files to PHPCS whitelist for automatic linting:' +
stringifiedFilesList
);
}
}
// skip if there are no warnings.
if ( results.warnings.length > 0 || results.fails.length > 0 ) {
markdown(
"This is an automated check which relies on [`PULL_REQUEST_TEMPLATE`](https://github.com/Automattic/jetpack/blob/master/.github/PULL_REQUEST_TEMPLATE.md). We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation :robot:"
);
} else {
markdown(
`**Thank you for the great PR description!**
When this PR is ready for review, please apply the \`[Status] Needs Review\` label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.`
);
setReleaseDates();
}
// Adds release and code freeze dates according to x.x milestone due date
function setReleaseDates() {
schedule( async () => {
let jetpackReleaseDate;
if ( ! whitelistedPath ) {
notWhitelistedFiles.push( file );
}
} );
if ( notWhitelistedFiles.length > 0 ) {
const stringifiedFilesList = '\n' + notWhitelistedFiles.join( '\n' );
fail(
'Please add these new PHP files to PHPCS whitelist for automatic linting:' +
stringifiedFilesList
);
}
}
// skip if there are no warnings.
if ( results.warnings.length > 0 || results.fails.length > 0 ) {
markdown(
"This is an automated check which relies on [`PULL_REQUEST_TEMPLATE`](https://github.com/Automattic/jetpack/blob/master/.github/PULL_REQUEST_TEMPLATE.md). We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation :robot:"
);
} else {
markdown(
`**Thank you for the great PR description!**
When this PR is ready for review, please apply the \`[Status] Needs Review\` label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.`
);
setReleaseDates();
}
// Adds release and code freeze dates according to x.x milestone due date
function setReleaseDates() {
schedule( async () => {
let jetpackReleaseDate;
// Use labels please!
const ghLabels = danger.github.issue.labels;
if ( ! ghLabels.find( l => l.name.toLowerCase().includes( '[status]' ) ) ) {
warn(
'The PR is missing at least one [Status] label. Suggestions: `[Status] In Progress`, `[Status] Needs Review`'
);
}
// Test instructions
if ( ! danger.github.pr.body.toLowerCase().includes( 'testing' ) ) {
warn( '"Testing instructions" are missing for this PR. Please add some.' );
}
// skip if there are no warnings.
if ( results.warnings.length > 0 || results.fails.length > 0 ) {
markdown(
"This is an automated check which relies on [`PULL_REQUEST_TEMPLATE`](https://github.com/Automattic/wp-calypso/blob/master/.github/PULL_REQUEST_TEMPLATE.md). We encourage you to follow that template as it helps Calypso maintainers do their job. If you think 'Testing instructions' are not needed for your PR - please explain why you think so. Thanks for cooperation :robot:"
);
}