Skip to content

Commit

Permalink
Adds a danger rule for when you keep the username from the template (D…
Browse files Browse the repository at this point in the history
  • Loading branch information
orta authored Jun 8, 2020
1 parent d886755 commit 44af094
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ if (danger.git.created_files.some(f => path.basename(f) === ".editorconfig")) {
fail("A nested .editorconfig file may not be added to a package on DefinitelyTyped. Please respect the root .editorconfig.", danger.git.created_files.find(f => path.basename(f) === ".editorconfig"), 1)
}

// Tell people that they've added @me to their lib and not themselves
const newDTSFiles = danger.git.created_files.filter(f => f.endsWith(".d.ts"))
newDTSFiles.forEach(dts => {
const file = fs.readFileSync(dts, "utf8")
if (file.includes("<https://github.com/me>")) {
fail("This line should have your github username in it, not /me", dts, 3)
}
})

for (const filename of danger.git.modified_files.concat(danger.git.created_files)) {
danger.git.diffForFile(filename).then(d => {
Expand Down

0 comments on commit 44af094

Please sign in to comment.