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

Isort and black conflict when formatting a file #868

Closed
ipdemes opened this issue Mar 28, 2023 · 3 comments
Closed

Isort and black conflict when formatting a file #868

ipdemes opened this issue Mar 28, 2023 · 3 comments
Assignees

Comments

@ipdemes
Copy link
Contributor

ipdemes commented Mar 28, 2023

It seems like isort and black conflict when formating this file : https://github.com/ipdemes/cunumeric/blob/vectorize/typings/numba/__init__.pyi
This result in CI failure for pre-commit for the Vectorize PR

@bryevdv
Copy link
Contributor

bryevdv commented Apr 3, 2023

@ipdemes isort does not like the vertical space, even with the comments, but black insists on it. I am not sure of any way to get them happy together with the comments "inline", so the simplest thing to do would just be this:

diff --git a/typings/numba/__init__.pyi b/typings/numba/__init__.pyi
index 571faf5a..3aa25ebb 100644
--- a/typings/numba/__init__.pyi
+++ b/typings/numba/__init__.pyi
@@ -1,14 +1,9 @@
 from typing import Any, Callable
 
-# Re-export types itself
 import numba.core.types as types
 import numba.cuda  # import compile_ptx
-
-# import types
 from numba.core import types
 from numba.core.ccallback import CFunc
-
-# Re-export all type names
 from numba.core.types import CPointer, uint64
 
 def cfunc(sig: Any) -> Any:

if you think the comments are crucial, they could go at the end of each line instead.

@ipdemes
Copy link
Contributor Author

ipdemes commented Apr 3, 2023

@bryevdv : thank you! I think we can live without this comments. Do you want to push this changes ?

@ipdemes
Copy link
Contributor Author

ipdemes commented Apr 3, 2023

I just pushed this change with other changes. Thank you.

@ipdemes ipdemes closed this as completed Apr 3, 2023
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