I found the following gitDSL functions to access information in individual files
//This should make it really easy to do work when specific keypaths have changed inside a JSON file.
JSONDiffForFile(filename: string) => Promise
// Provides a JSON patch (rfc6902) between the two versions of a JSON file, returns null if you don't have any changes for the file in the diff.
// Note that if you are looking to just see changes like: before, after, added or removed - you should use `JSONDiffForFile` instead, as this can be a bit unwieldy for a Dangerfile.
JSONPatchForFile(filename: string) => Promise
// Offers the diff for a specific file
diffForFile(filename: string) => Promise
// Offers the overall lines of code added/removed in the diff
linesOfCode() => Promise
// Offers the structured diff for a specific file
structuredDiffForFile(filename: string) => Promise
(Documentation on these functions: https://danger.systems/js/reference.html#GitDSL)
With danger.git.structuredDiffForFile
I'm able to calculate lines I would like to exclude as so
const file = 'yarn.lock';
const diff1 = await danger.git.structuredDiffForFile(file);
const excludedLines = diff1.chunks[0].changes.length