Skip to content

Instantly share code, notes, and snippets.

@mayankagarwal2402
Created October 8, 2021 01:29
Show Gist options
  • Save mayankagarwal2402/24894cfaccc3a60446caed88f2fe731e to your computer and use it in GitHub Desktop.
Save mayankagarwal2402/24894cfaccc3a60446caed88f2fe731e to your computer and use it in GitHub Desktop.
hide/mark as viewed the vendor files in your PR if you manage vendor depencies inside your golang project for clutter free review
// Usage:
// open the files tab in the PR you want to review with vendor files
// copy paste following function in your developer tools console and run the func hideVendorFiles()
function hideVendorFiles() {
var lp = document.querySelectorAll('div.file-info a.Link--primary')
var lp2 = [...lp].filter(l => l.title.startsWith('vendor/'))
for (l of lp2) {
var chkbx = l
.parentNode
.parentNode
.querySelector('input.js-reviewed-checkbox')
console.log(chkbx.checked)
if (!chkbx.checked) {
chkbx.click()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment