Skip to content

Black version mismatch between pre-commit hooks and CI causing linting failures #62

@jeremymanning

Description

@jeremymanning

🔧 Problem Description

CI is failing on black formatting checks despite pre-commit hooks passing locally, indicating a version mismatch between different environments.

📋 Technical Details

Current State:

  • Local black version: 25.1.0
  • Pre-commit hook version: 23.12.1 (defined in .pre-commit-config.yaml)
  • CI environment: Unknown version (likely different from both above)

Impact:

  • Code passes local pre-commit checks but fails CI
  • Different black versions format code slightly differently
  • Inconsistent developer experience

🚨 Specific Error

Run black --check clustrix/ tests/
would reformat /Users/runner/work/clustrix/clustrix/tests/test_cloud_providers_azure.py

Oh no! 💥 💔 💥
1 file would be reformatted, 53 files would be left unchanged.
Error: Process completed with exit code 1.

✅ Immediate Fix Applied

  • Hash: 312a8be - Fixed formatting in the specific file to unblock CI

🎯 Proper Solution Needed

We need to standardize black versions across all environments:

  1. Update .pre-commit-config.yaml to use a consistent black version
  2. Pin black version in CI to match pre-commit hooks
  3. Document black version in development setup

🔍 Investigation Required

  • Check what black version CI is actually using
  • Determine the best black version to standardize on
  • Update pre-commit configuration
  • Test that pre-commit hooks catch what CI catches

📁 Related Files

  • .pre-commit-config.yaml (line 3: rev: 23.12.1)
  • CI configuration files
  • Any developer documentation about code formatting

This ensures consistent code formatting across all development environments and prevents CI failures due to version mismatches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions