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

Conflict execution when multiple format on save is triggered #1

Closed
tomy0000000 opened this issue Apr 28, 2021 · 2 comments
Closed

Conflict execution when multiple format on save is triggered #1

tomy0000000 opened this issue Apr 28, 2021 · 2 comments

Comments

@tomy0000000
Copy link

I have both black and isort install, and both of them have "format on save" feature enabled.

Occasionally, when one of the format is triggered, says black, the modification will trigger isort formating, which will then back trigger black, and the loop goes on until I manually disable one of the extension.
Sometimes, this does not happen, but yield an incorrect code. (duplicate lines with wrong indentation or syntax error)

Maybe there should be a callback to coordinate the priority of the trigger. Although IMHO, this probably should be solved on Nova's side.

@Aeron
Copy link
Owner

Aeron commented May 12, 2021

Thanks. I see what I can do about it. Unfortunately, I’m not using Nova for anything these days because even the Python syntax is not as good as it should be.

@Aeron Aeron closed this as completed in 12cb934 May 19, 2021
Aeron added a commit to Aeron/isort.novaextension that referenced this issue May 19, 2021
@Aeron
Copy link
Owner

Aeron commented May 19, 2021

Ok, now this should cause no trouble. I rewrote both formatters (for Black and isort extensions) a bit to use promises, so Nova should handle all pre-save events properly. It means no excessive saving or infinite loops anymore.

New versions are already available in the extension library.

Let me know if anything.

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