Skip to content

SG-43835 Fix black pre-commit/CI discrepancy by removing exclude#1111

Draft
stevelittlefish wants to merge 3 commits into
masterfrom
ticket/SG-43835-fix-black-precommit-exclude
Draft

SG-43835 Fix black pre-commit/CI discrepancy by removing exclude#1111
stevelittlefish wants to merge 3 commits into
masterfrom
ticket/SG-43835-fix-black-precommit-exclude

Conversation

@stevelittlefish

@stevelittlefish stevelittlefish commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove exclude: "tests|python/tank" from the black hook in .pre-commit-config.yaml so local pre-commit and CI run black on the same set of files
  • Apply black formatting to the 78 previously-excluded files in tests/ and python/tank/ to bring them into compliance
  • Disabled black from the Hound CI bot

Root cause

The CI pipeline (via tk-ci-tools) runs black with no exclusions, while the local pre-commit config excluded tests/ and python/tank/. This caused pre-commit to pass locally on unformatted files in those directories, only for CI to fail.

Test plan

  • CI code-style-validation job passes
  • pre-commit run --all passes locally

Remove the `exclude: "tests|python/tank"` override from the black hook
in `.pre-commit-config.yaml` so that local pre-commit runs black on the
same set of files as the CI pipeline. Apply black formatting to the
previously-excluded files to bring them into compliance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.33083% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.45%. Comparing base (c6204cc) to head (96646b2).

Files with missing lines Patch % Lines
python/tank/platform/qt/ui_busy_dialog.py 0.00% 19 Missing ⚠️
python/tank/path_cache.py 50.00% 5 Missing ⚠️
python/tank/commands/switch.py 0.00% 4 Missing ⚠️
python/tank/authentication/app_session_launcher.py 0.00% 3 Missing ⚠️
python/tank/bootstrap/manager.py 66.66% 2 Missing ⚠️
python/tank/commands/get_entity_commands.py 0.00% 2 Missing ⚠️
python/tank/commands/path_cache.py 0.00% 2 Missing ⚠️
python/tank/authentication/session_cache.py 0.00% 1 Missing ⚠️
...hon/tank/authentication/sso_saml2/core/__init__.py 0.00% 1 Missing ⚠️
...ication/sso_saml2/core/username_password_dialog.py 0.00% 1 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1111      +/-   ##
==========================================
- Coverage   79.45%   79.45%   -0.01%     
==========================================
  Files         206      206              
  Lines       21007    21013       +6     
==========================================
+ Hits        16692    16696       +4     
- Misses       4315     4317       +2     
Flag Coverage Δ
Linux 78.93% <82.33%> (-0.01%) ⬇️
Python-3.10 79.27% <82.33%> (-0.01%) ⬇️
Python-3.11 79.18% <82.33%> (-0.01%) ⬇️
Python-3.13 79.18% <82.33%> (-0.01%) ⬇️
Python-3.9 79.24% <82.33%> (-0.01%) ⬇️
Windows 78.96% <82.33%> (-0.01%) ⬇️
macOS 78.94% <82.33%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

stevelittlefish and others added 2 commits June 30, 2026 16:00
Re-run black at the correct pinned version (26.5.1) to catch files
missed by the initial formatting pass which used an older version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Hound runs its own black version which differs from the one pinned in
.pre-commit-config.yaml, causing spurious review comments. Black
formatting is already enforced by the CI pipeline via pre-commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# location:
# name: tk-core
# type: app_store
# type: app_store

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'app_store'

# common.apps.tk-multi-shotgunpanel:
# location:
# type: app_store
# type: app_store

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'app_store'

#
# common.engines.tk-maya.location:
# type: app_store
# type: app_store

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'app_store'

"userLogin": "john",
},
}
self.httpd.router["[PUT]/internal_api/app_session_request/a1b2c3"] = (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black would make changes.

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