Refactor Scanner.scanFile
What does this MR do?
-
Scanner.ScanFile
is renamed toscanFile
. 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 existingscanner.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?
- [NA] Changelog entry added
-
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer
Edited by Fabien Catteau