-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Support isolated folder for monorepo #628
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you! Excellent idea 👍🏻
__dirname + '/../fixtures' | ||
], | ||
skipIsolated: [ | ||
['packages/businessA', 'packages/businessB', 'packages/businessC'], |
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.
Thank you for the PR, it is a brilliant idea!
May I suggest some changes, we have a similar option named --skipLocal
for show duplications across the folders, the --skipLocal
used path
array from options to define folders, I guess we should use the same way here, what do you think?
The result will be like:
(async () => {
const clones = await detectClones({
path: [
'packages/businessA',
'packages/businessB',
'packages/businessC'
],
skipIsolated: true,
silent: true
});
console.log(clones);
})()
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.
@kucherenko Thank you for your advice. Sorry, I didn't describe it clearly.
--skipIsolated means that submodules (packages/businessA, packages/businessB etc) can be isolated from each other when the detect path is the monorepo home project. And, other folders still want to be included in the clone code statistics normally.
(async () => {
const clones = await detectClones({
path: ['./'], // e.g. detect clones from packages/businessA + globals + libs
skipIsolated: [
[ 'packages/businessA', 'packages/businessB', 'packages/businessC'],
],
silent: true
});
console.log(clones);
})()
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.
ok, sounds good, will merge the PR and publish new version
我已收到你的邮件
|
For the business-oriented of monorepo repository, the folders under packages are usually owned by different business teams. There is no relationship between the business teams whether the code is repeated with other teams. Each business group only concerns its global capabilities, or whether the infrastructure is repeated.
Therefore, I want to extend a skipIsolated field to prevent duplication detection between isolated folders.
the clones between packages/businessA with packages/businessB will be detected.
the clones between packages/businessA with packages/businessB will be skipped.
This change is