Skip to content

fix: Align line-length configuration between pyproject.toml and pre-commit#86

Open
hobostay wants to merge 1 commit intozai-org:mainfrom
hobostay:fix/black-line-length-inconsistency
Open

fix: Align line-length configuration between pyproject.toml and pre-commit#86
hobostay wants to merge 1 commit intozai-org:mainfrom
hobostay:fix/black-line-length-inconsistency

Conversation

@hobostay
Copy link

@hobostay hobostay commented Feb 9, 2026

Summary

Fix configuration inconsistency between pyproject.toml and .pre-commit-config.yaml regarding line length limits.

Problem

The black formatter was configured with line-length=100 in pyproject.toml, but the pre-commit hooks were using --line-length=88. This inconsistency causes several issues:

  1. Inconsistent formatting: Code formatted via pre-commit (black --line-length=88) would differ from code formatted directly with black (which reads line-length=100 from pyproject.toml)
  2. CI/CD failures: Builds could fail if CI uses different formatting configuration than local pre-commit hooks
  3. Developer confusion: Unclear which line length limit (88 or 100) is the actual project standard

Solution

Update .pre-commit-config.yaml to use line-length=100 for both black and flake8, matching the pyproject.toml configuration.

Changes Made

# .pre-commit-config.yaml
- args: ["--line-length=88"]   # black
+ args: ["--line-length=100"]  # black

- args: ["--max-line-length=88", "--extend-ignore=E203,W503,E501"]  # flake8
+ args: ["--max-line-length=100", "--extend-ignore=E203,W503,E501"]  # flake8

Impact

  • Low risk: This only aligns existing configuration; no code formatting changes are included in this PR
  • Improves consistency: Ensures all tooling uses the same 100-character line limit
  • Prevents future issues: Developers won't encounter formatting mismatches between local and CI environments

Test plan

This is a configuration-only fix with no code changes. The change ensures:

  • Pre-commit hooks now respect the same 100-character limit defined in pyproject.toml
  • Running black . locally will produce the same results as pre-commit
  • Existing code remains unchanged (no reformatting included in this PR)

🤖 Generated with Claude Code

…ommit

The black formatter was configured with line-length=100 in pyproject.toml,
but the pre-commit hook was using --line-length=88. This inconsistency
could lead to:
- Code being formatted differently when run via pre-commit vs. black directly
- CI/CD failures if formatting checks use different configurations
- Developer confusion about which line length limit is correct

This commit updates .pre-commit-config.yaml to use line-length=100 for both
black and flake8, matching the pyproject.toml configuration.

Changes:
- black args: --line-length=88 → --line-length=100
- flake8 args: --max-line-length=88 → --max-line-length=100

This ensures consistent code formatting across all tooling.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant