Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
[Brief description ]
- [more description]
- [more description]
- [more description]
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| // Import JSON parser, place it at the top of the file | |
| import groovy.json.JsonSlurper | |
| // Read package.json and return `version` field | |
| def getVersionFromNpm() { | |
| // Read and parse package.json file from project root | |
| def inputFile = new File("$rootDir/../package.json") | |
| def packageJson = new JsonSlurper().parseText(inputFile.text) | |