for (GHPullRequestFileDetail fileDetail : pr.listFiles()) { paths.add(fileDetail.getFilename());
/** * GitHub expect review comments to be added on "patch lines" (aka position) but not on file lines. * So we have to iterate over each patch and compute corresponding file line in order to later map issues to the correct position. * @return Map File path -> Line -> Position */ private Map<String, Map<Integer, Integer>> mapPatchPositionsToLines(GHPullRequest pr) throws IOException { Map<String, Map<Integer, Integer>> result = new HashMap<>(); for (GHPullRequestFileDetail file : pr.listFiles()) { Map<Integer, Integer> patchLocationMapping = new HashMap<>(); result.put(file.getFilename(), patchLocationMapping); if (config.tryReportIssuesInline()) { String patch = file.getPatch(); if (patch == null) { continue; } processPatch(patchLocationMapping, patch); } } return result; }