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

Black 24.4.2 is not compatible Black 24.8.0 #530

Closed
KelvinChung2000 opened this issue Aug 7, 2024 · 1 comment
Closed

Black 24.4.2 is not compatible Black 24.8.0 #530

KelvinChung2000 opened this issue Aug 7, 2024 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.

Comments

@KelvinChung2000
Copy link

Diagnostic Data

  • Python version (& distribution if applicable, e.g., Anaconda): Python3.10
  • Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): No
  • Operating system (and version): Mac Os
  • Version of tool extension you are using: Latest

Behaviour

Expected Behavior

Format with the extension will not fail the linting with latest Black

Actual Behavior

Black 24.4.2 does not passing the CI that uses Black 24.8.0

Logs:

Information on the failing CI

@@ -872,19 +871,17 @@
                 logger.warning(
                     f"Faulty padding argument, defaulting to {paddingDefault}"
                 )
                 padding = paddingDefault
         else:
-            logger.info(
-                f"No padding specified, defaulting to {paddingDefault}")
+            logger.info(f"No padding specified, defaulting to {paddingDefault}")
             padding = paddingDefault
 
         if 4 <= padding <= 32:
             self.fabricGen.genGeometry(padding)
             logger.info("Geometry generation complete")
-            logger.info(
-                f"{geomFile} can now be imported into the FABulous Editor")
+            logger.info(f"{geomFile} can now be imported into the FABulous Editor")
         else:
             logger.error("padding has to be between 4 and 32 inclusively!")
@KelvinChung2000 KelvinChung2000 added the bug Issue identified by VS Code Team member as probable bug label Aug 7, 2024
@github-actions github-actions bot added the triage-needed Issue is not triaged. label Aug 7, 2024
@karthiknadig
Copy link
Member

@KelvinChung2000 If you want to use latest black, you can set black-formatter.importStrategy to fromEnvironment, and install latest black in your environment. The extension provides various ways for you to configure it so that it always matches your CI.

Here are the options:

  1. black-formatter.importStrategy allows you to use black from the environment. This means if you have different versions of black used in different projects, this will pick black from environment so always matching the project.
  2. black-formatter.path this setting allows you to set path to a black formatter. If you us the same black formatter, you can install it into a global tools environment using tools like pipx. Then point the extension to use black from that environment.

The extension itself ships with black but sometimes tools might release newer versions, and the above settings can help you use the one that works for you.

@karthiknadig karthiknadig self-assigned this Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

2 participants