Skip to content

Cleaned up configuration for isort and black#43

Closed
JonathanWenger wants to merge 5 commits intomainfrom
dev-tooling
Closed

Cleaned up configuration for isort and black#43
JonathanWenger wants to merge 5 commits intomainfrom
dev-tooling

Conversation

@JonathanWenger
Copy link
Collaborator

In a Nutshell

Configuration between linters isort and black was only handled in pre-commit hooks and could lead to conflicts.

In Detail

When running pre-commit hooks and also locally installing black via the instructions in CONTRIBUTING.md one could end up with different versions / settings leading to reformatting from the pre-commit hooks every commit. I also fixed the exclusions in the pre-commit configuration along the way, since it was throwing warnings:

 ▶ git commit -m "foo"
[WARNING] The 'exclude' field in hook 'flake8' is a regex, not a glob -- matching '/*' probably isn't what you want here
[WARNING] The 'exclude' field in hook 'black' is a regex, not a glob -- matching '/*' probably isn't what you want here
[WARNING] The 'exclude' field in hook 'isort' is a regex, not a glob -- matching '/*' probably isn't what you want here
[WARNING] The 'exclude' field in hook 'require-ascii' is a regex, not a glob -- matching '/*' probably isn't what you want here
[WARNING] The 'exclude' field in hook 'forbid-binary' is a regex, not a glob -- matching '/*' probably isn't what you want here

@JonathanWenger JonathanWenger added the bug Something isn't working label Dec 16, 2022
@JonathanWenger JonathanWenger self-assigned this Dec 16, 2022
@JonathanWenger
Copy link
Collaborator Author

It seems like there are some inconsistencies in the import formatting in the current library. Let me know if you're fine with me just reformatting the imports in this PR.

@Balandat
Copy link
Collaborator

How do you (and @gpleiss, @jacobrgardner) feel about using µfmt (https://ufmt.omnilib.dev/en/stable/)? This takes care of the conflicts between black and isort, we've been using it without issues in BoTorch for a long time now.

@gpleiss
Copy link
Member

gpleiss commented Dec 16, 2022

I am 100% in favor of any dev practices you all use for BoTorch :)

@Balandat
Copy link
Collaborator

Done in #56.

@Balandat Balandat closed this Mar 30, 2023
@JonathanWenger JonathanWenger deleted the dev-tooling branch March 30, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants