Change8

Migrating to Black 26.1.0

Version 26.1.0 introduces 2 breaking changes. This guide details how to update your code.

Released: 1/18/2026

2
Breaking Changes
2
Migration Steps
2
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

_width_table.pypathspec

Breaking Changes

Issue #1

The logic for ignoring files based on `.gitignore` patterns has been updated to match Git's behavior more closely. Previously, if a parent directory was unignored, files within it might still be formatted even if they matched an ignore pattern. Now, files will be ignored if a pattern matches them, even if the parent directory is directly unignored. To ensure a directory and all its children are included (unignored), use a pattern like `!*/directory_name/` instead of just `!directory_name/` if you need to override subdirectory ignores.

Issue #2

The behavior of `.gitignore` matching has changed: files will now be ignored if a pattern matches them, even if the parent directory is directly unignored. If you previously relied on unignoring a directory to override nested ignores, you might need to adjust your `.gitignore` file (e.g., by adding `*/` prefixes to include patterns).

Migration Steps

  1. 1
    Review your `.gitignore` files if you rely on complex include/exclude logic involving parent directories, as the ignore matching now strictly follows Git's behavior where file matches override directory unignores.
  2. 2
    If you need to unignore all children of a directory, ensure your unignore pattern uses a wildcard prefix, e.g., `!*/directory_name/`.

Release Summary

This release introduces the 2026 stable style, bringing numerous formatting improvements and fixes, and updates the underlying ignore logic to precisely match Git's behavior regarding `.gitignore` patterns.

Need More Details?

View the full release notes and all changes for Black 26.1.0.

View Full Changelog