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

tach sync overwrites top-level configuration #475

Open
miketheman opened this issue Dec 15, 2024 · 1 comment
Open

tach sync overwrites top-level configuration #475

miketheman opened this issue Dec 15, 2024 · 1 comment

Comments

@miketheman
Copy link

If manual configurations like ignore_type_checking_imports = true or forbid_circular_dependencies = true is added to tach.toml, any subsequent execution of tach sync will clobber any of those configuration items and remove them.

This can be surprising to someone new to tach, and lead to questions like "what's the right workflow for this tool?"

A better experience would be for the commands that produce configuration changes to isolate their rewrites to only the sections or config keys they are responsible for, and leave others alone.

This is the same for any hand-written comments to the configuration file, so either there needs to be clearer documentation on when to run tach sync, or to preserve/exclude certain keys from being removed when the config is written, or some other solution

@emdoyle
Copy link
Member

emdoyle commented Dec 16, 2024

Hi @miketheman, appreciate the detailed issue!

The behavior you're seeing with top-level configuration being removed is actually due to tach sync removing default values. The edits are probably still surprising, but it will at least preserve behavior.

I agree with your point though, we do want to preserve other information like comments and we should avoid edits which aren't related to dependencies during tach sync. It probably means a bit of custom parsing logic from what I can tell.

It's not as simple as our current flow, which is just to re-dump the config into TOML after making the changes, but it would definitely improve the experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants