-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Folders are not properly added to the folder exclusion list when scanning files on Windows. #859
Comments
Do you believe it is reading those folders and files? Our exclusion list is pretty large and it doesn't complain about inability to read things like jpg for example. Is it just that its not showing you the default list correctly and that would help for debugging purposes? Since you note its benign, I presume that is the case but wanted to clarify. Of course it should show the list correctly if discovered as that would be important for not only debugging but understanding how the plugin works. |
The problem is that it reads every file name, not the contents, in folders that should be excluded. I say that it is benign until you get huge folders like The |
ok thank you for description. this indeed would explain why some repos run so slow when they really shouldn't. I'll try to look into this soon but likely after Thanksgiving. |
20faa4d introduces the bugs. I had for the longest time searching for why this plugin is so incredibly slow. I used https://github.com/mybatis/mybatis-3/ to test. It is incredibly slow in general. After making adjustments to the class affected by this, mybatis ran quickly. It still properly added license headers as expected. I think this issue is the long nirvana to fixing this plugin speed. I'll send up a draft for fix. Basic gist is that a method used to find the directories to ignore failed to use the correct check and was hard coded to '/' which would fail on windows to add as indicated here. After fixing it up, the list is generated as would be expected and how to be expected (user ignores first then the default list). |
ok I don't think this actually solves long standing issue I have with this plugin after further testing. Do I think it would improve thins to not read files we don't need to, yes. See #870 for work I've done on this as a starting point. Its not complete as tests don't pass due to LF hard-coding at least for windows. GHA will confirm the *nix side of things. I agree original logic appears wrong and at worst confusing. However really thinking about it, reading files doesn't necessary end up extremely slow. Writing files would be slower but avoiding any git related actions if any taken would be where performance would degrade IMO. It still warrants review, fix for clarify as its super confusing that excludes for directories exist and it didn't account for any (at least on windows) due to incorrect coding usage. |
Version affected
Running on the latest version (4.6) on Windows 10.
Describe the bug
Building the exclusions in
Selection::buildExclusions
adds all excludes to the list without regard for the system's path-separator. TheDirectoryScanner
used inSelection::scanIfneeded
automatically converts file separators to the proper ones, including thename
used in theScanConductor
, so folders that should be excluded are not.This is largely a benign bug that only shows its fangs when large, auto-generated folders like
node_modules
or.vite
are created.How to Reproduce
license:format
with debug enabled. The bug should also be able to be seen onlicense:check
andlicense:remove
.Starting to visit {basedir}, excluding directories: []
. Observe default folders and others are not properly added to folder excludes.**\node_modules\**
to the plugin settings/parameters.Hopefully, that should be enough to reproduce the bug...
The text was updated successfully, but these errors were encountered: