ymotongpoo / vsc-licenser

License handler extension for Visual Studio Code.
Apache License 2.0
45 stars 40 forks source link

Insert license headers to all files in the workspace also tries to add headers to gitignored dependency folders #131

Open SeriousBug opened 2 years ago

SeriousBug commented 2 years ago

Please make sure to use this template to report issue. Any issue report that does not follow this template will be ignored.

Runtime environment

You can confirm installed extensions by calling "Extensions: Show Installed Extensions", or just click extensions tab in the case you are using VS Code 1.3+.

Behaviors

Expected behavior

The "Insert license headers to all files in the workspace" should only add headers to files that are in the workspace proper, and not to folders like node_modules or target (rust build directory). I have these folders in .gitignore.

Actual behavior

Licenser tries to apply the header to these files as well. This causes the process to take very long and also means

Steps to reproduce the issue

  1. Create a new project, or grab an existing project that uses node.js.
  2. Use npm or yarn to grab all dependencies for that project.
  3. Use the command to add license headers to all files in the workspace. This step will take a few minutes, and you can see afterwards that the dependency files under node_modules will have the header too.
SeriousBug commented 2 years ago

It also would be nice to have an option to ignore certain types of files, like svg files which I wouldn't want to add license information into.

It also added license information to files that it really shouldn't, like Cargo.toml, .vscode/settings.json, LICENSE.txt, app.json and such. The `json' files are especially bad because not all json parsers support comments.

mhp-borisbojic commented 1 year ago

It also would be nice to have an option to ignore certain types of files, like svg files which I wouldn't want to add license information into.

It also added license information to files that it really shouldn't, like Cargo.toml, .vscode/settings.json, LICENSE.txt, app.json and such. The `json' files are especially bad because not all json parsers support comments.

Exactly this I wanted to mention as well ... it would be nice to exclude certain file types, especially JSON files ...