-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(check:policy): Add policy handler to check for extraneous lockfiles #12726
Conversation
build-tools/packages/build-tools/src/repoPolicyCheck/handlers/lockfiles.ts
Outdated
Show resolved
Hide resolved
if (Array.isArray(arr)) { | ||
knownPaths.push(...arr.map((p) => p.toString())); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above seems compute the same thing again and again. Should we cache it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored this out into a get function that calculates the known paths once and returns the cached value subsequently.
806916e
to
bdf5bed
Compare
Adds a policy handler that checks that package-lock.json files appear only in the root of release groups or independent packages. Additional paths can be added to the fluidBuild.additionalLockfilePaths array in package.json.
Related to #9956.