Skip to content

Refactor Scanner.scanFile

Fabien Catteau requested to merge 338252-refactor-scanfile into master

What does this MR do?

  • Scanner.ScanFile is renamed to scanFile. In the past this method was used by gemnasium-maven, but this is no longer the case, and it should no be exported.
  • scanFile updates an existing scanner.File struct instead of returning a new one. This simplifies the code a lot, and prepares the code for !235 (merged).
  • Some low level functions used by ScanFile are removed, for clarity and ease of maintenance. scanReader used to be exported but that's no longer the case.

This is prep work for !235 (merged): since scanFile now updates an existing File struct, it will be possible for ScanProjects to set File.PackageManager directly, using the PackageManager field of the scanned finder.Project. It's cleaner compare to tweaking the new File struct returned by the old ScanFile method.

What are the relevant issue numbers?

gitlab-org/gitlab#338252 (closed)

Does this MR meet the acceptance criteria?

Edited by Fabien Catteau

Merge request reports

Loading