-
Notifications
You must be signed in to change notification settings - Fork 59
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
Don't style text when output terminal is not interactive #679
Comments
@pavelzw I'll fix this! We have functions to detect this but they are scattered across the Python/Rust boundary. This output is entirely rendered in Rust I believe, so should be a straightforward fix. It'll take some time to work through the rest of the formatting/stdout issues you've raised but they seem reasonable. Could I ask about your use case? I'd love to learn more about how you're using Tach's output so that we can build in that direction :) |
Basically i'm trying to build a tool that checks within my project that i only use certain external dependencies in certain submodules allow:
# only allow importing the `logging` module in the following submodules
logging:
- my_project.log
# The below directories should be migrated in the near future.
# We should remove each directory as they are migrated.
- my_project.legacy
# ...
deny:
# Packages that exist under this tag will be denied usage
# in precisely these modules.
pandas:
- my_project.new The idea was to leverage |
Ok I see! I just made the changes to fix styling in the report, this will merge and release later today. Note that the paths in the non-interactive report will be absolute. Your actual use-case is something that Tach will support first-class very soon. Do you have a strong preference to define these rules on the external dependencies vs. opt-in on each module? The most natural extensions for Tach config would be |
When writing the report to a file, the styling doesn't get removed and results in ascii escape sequences in the file:
opening this in my IDE:
I would expect something like this instead (also without the warning, xref #676):
The text was updated successfully, but these errors were encountered: