snyk / snyk-gradle-plugin

Basic Snyk CLI plugin for Gradle support
Other
25 stars 19 forks source link

refactor: treat --sub-project option like --file option, as defaultProj #225

Closed magdziarek closed 1 year ago

magdziarek commented 2 years ago

What this does

Notes for the reviewer

The change does something to the rootPkg.name value, therefore there are some commented lines in multi-project.test.ts. The test doesn't look reliable - the results for the test with --sub-project set where the --sub-project value needs trimming should be the same as for when it's not trimmed. Where is rootPkg used and can we change it?

Don't think this is how we should set the projectName because this is not a reliable way to determine if project is a subproject (in case there are duplicates) and I am not sure why we want this format of name (a path from root?) - does this matter for anything?

    const isSubProject = projectId !== defaultProject;

    let projectName = isValidRootDir ? path.basename(root) : defaultProject;

    if (isSubProject) {
      projectName = isValidRootDir
        ? `${path.basename(root)}/${projectId}`
        : `${defaultProject}/${projectId}`;
    } 
ghost commented 1 year ago

This PR modifies files linked to issues tracked in Stepsize. You might want to review their status, priority, and scope.

Use Lenient Configuration by default - `lib/init.gradle`

 Mention [stepsize] in a comment if you'd like to report some technical debt. See examples here.