rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[ rush scan] feat: modify rush scan, support executing projects under rush and custom scanning folders.

Open sherlockfeng opened this issue 1 year ago • 2 comments

Summary

  • Support for using -o to specify the project to be scanned in a repository that has been connected to rush.
  • Support for specifying the folder to be scanned.

Details

When I was migrating a pnpm workspace project to rush.
I first set up rush.json and wrote in all the projects.

Using -o to specify the project to be scanned can avoid me going into each project directory to execute scan.

The folders to be scanned under the project are not uniform, so I got all the folders under the project, and used ignore to read the .gitignore file to exclude, and finally got all the folders to be scanned, so this requires customizing the folders to be scanned.

How it was tested

  • build rush-lib

  • cd libraries/rush-lib/src/cli/actions/test/scanRepo

  • executenode <path to rush>/libraries/rush-lib/lib-commonjs/start.js scan --json -o b --folder test-folder1 image

  • executenode <path to rush>/libraries/rush-lib/lib-commonjs/start.js scan --json -o a image

Why skip ScanAction.test.ts

image

sherlockfeng avatar Dec 16 '24 03:12 sherlockfeng

I think it may be useful to follow the rush approach and allow special filter types, ex. -o path:<path-to-folder> would include only the projects under a specific folder, instead of using a dedicated parameter. This would mean that you would be selecting all projects under that folder though, but I think that's pretty much what you're trying to accomplish here.

D4N14L avatar Dec 17 '24 19:12 D4N14L

oh, rush already has this -o path:<path-to-folder> filter ? i can change to use SelectionParameterSet to allow all rush filter. So in future, we can add other special filter in SelectionParameterSet @D4N14L what do you think ?

sherlockfeng avatar Dec 18 '24 03:12 sherlockfeng