-
Notifications
You must be signed in to change notification settings - Fork 8
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
An --ignores argument? #130
Comments
It seems what we need here is an Maybe add add a |
Isn't it more of an |
EDIT: Oh, but, wait. Hmmm. 🤔 |
You can now give this a try: # Creosote build from "exclude-packages" branch, issue 130
$ pipx install --suffix=@130 --force git+https://github.com/fredrikaverpil/creosote.git@exclude-packages
$ creosote@130 --exclude-packages [PACKAGE ...]
$ pipx uninstall creosote@130 Let me know if you encounter any issues! |
It's possible there is a use case for an
--ignore-packages
argument. The user can ignore certain packages and creosote would simply ignore reporting them as unused. The ignores already exists internally here so all that is needed to enable this is to pass an argument to the CLI and pass it onto that function.The use case could be e.g. using SQLAlchemy with a database driver. You wouldn't import the database driver in your own source code. Instead you would tell SQLAlchemy to use it via e.g. connection or engine creation string. This would be too tricky to support for Creosote, I think.
To avoid forgetting about the ignores (if e.g. discontinuing the use of said database driver above), Creosote could complain if an ignored package is no longer found in the dependency file (pyproject.toml, requirements.txt, ...), prompting the user to also remove the ignore.
🤔 Would it also be useful to ignore certain files/folders from the source code scan?
Anyhow, this would in that case be a different CLI argument, like
--ignore-paths
.I'm just leaving this thought here for now to simmer. Please upvote if you think this would be a good addition to Creosote. 😄
The text was updated successfully, but these errors were encountered: