Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

include/exclude configuration for black_on_save #42

Closed
craigds opened this issue Jan 16, 2019 · 5 comments
Closed

include/exclude configuration for black_on_save #42

craigds opened this issue Jan 16, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@craigds
Copy link

craigds commented Jan 16, 2019

Using this plugin with a large existing codebase is a little difficult. We don't want to black the whole thing at once, since that would conflict with all the open pull requests and generally just be a big burden.

So we've been blacking the code a piece at a time, as/when appropriate.

It'd be helpful if there was a whitelist for the black_on_save setting, where we could put all the directories we've blacked already, so they continue to be automatically blacked without having to cmd+shift+p and toggle black on save all the time.

@jgirardet
Copy link
Owner

Maybe I"m missing something, but I think you should tweak it with the include/exclude black option in a pyproject.toml or in the sublime project settings.
you exclude everything, and add blacked directory in include when you want it to be blacked

@craigds
Copy link
Author

craigds commented Jan 18, 2019

I suppose so. But black_on_save doesn't appear to respect include/exclude, it blacks on save if you tell it to and doesn't if you tell it not to. Is there a way to get it to respect include/exclude from the pyproject.toml?

@jgirardet
Copy link
Owner

I have to check it so. It shoud'nt

@jgirardet
Copy link
Owner

I was telling myself I already heard anything about it. and indeed : psf/black#438
The default black behaviour is to not ignore a path file specified in command line. that's why sublack does too.
But it make sense for black_on_save to disable it, I will not change it for the standard black command.

@jgirardet jgirardet added the enhancement New feature or request label Jan 18, 2019
@jgirardet
Copy link
Owner

ok with exlcude in 2.2.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants