Skip to content
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

ignore_type_checking_imports default value is false but documentation says it's true #523

Open
DetachHead opened this issue Jan 8, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@DetachHead
Copy link

https://docs.gauge.sh/usage/faq#are-conditional-imports-checked

here it says the following:

Tach will check all imports in your source files, including those which are called conditionally. The only exceptions are imports made within TYPE_CHECKING conditional blocks. If you want to disable checks for these imports, you can add ignore_type_checking_imports: true to your tach.toml.

however i had to add ignore_type_checking_imports = false to my tach.toml to get it to report TYPE_CHECKING imports, so it seems that it's actually true by default.

i'm not sure which one is intended, but i believe false by default is the way to go, to reduce the trisk of users not knowing about the option and not being made aware of TYPE_CHECKING imports that violate their rules. imo strict by default is always better

@emdoyle
Copy link
Member

emdoyle commented Jan 13, 2025

The docs have been corrected, thanks for pointing this out! The current default value is true, but the docs you quoted suggested that it was false. It's also confusing because of the negation in the name of the config value.

I'm open to switching to the strict default, but I would also want to identify those imports in the output of tach check, and provide guidance that this config exists.

I really appreciate your patience on this issue and the others you've raised. We've just shipped several heavy PRs and should now be able to resolve those issues later this week (we also have some older issues to return to).

@emdoyle emdoyle added the documentation Improvements or additions to documentation label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants