-
Notifications
You must be signed in to change notification settings - Fork 614
[BUG]: make pre-commit fails on check-executables-have-shebangs for tests/client/init.py #2731
Copy link
Copy link
Labels
SHOULDP2: Important but not vital; high-value items that are not crucial for the immediate releaseP2: Important but not vital; high-value items that are not crucial for the immediate releasebugSomething isn't workingSomething isn't working
Milestone
Description
🐞 Bug Summary
The make pre-commit task fails with a shebang check error on tests/client/__init__.py, which is marked as executable but has no shebang. This occurs on both Mac and Linux platforms.
🧩 Affected Component
Select the area of the project impacted:
-
mcpgateway- API -
mcpgateway- UI (admin panel) -
mcpgateway.wrapper- stdio wrapper - Federation or Transports
- CLI, Makefiles, or shell scripts
- Container setup (Docker/Podman/Compose)
- Other (explain below)
🔁 Steps to Reproduce
- Run
make pre-commiton Mac or Linux - Observe the failure in the check-executables-have-shebangs hook
- Alternatively run
uv run --active pre-commit run --config .pre-commit-lite.yaml check-executables-have-shebangs --all-files
🤔 Expected Behavior
The pre-commit hook should pass without errors. Python __init__.py files should not be marked as executable since they are module initialization files, not standalone scripts.
📓 Logs / Error Output
✅ Check Executables Have Shebangs.......................................Failed
- hook id: check-executables-have-shebangs
- exit code: 1
tests/client/__init__.py: marked executable but has no (or invalid) shebang!
If it isn't supposed to be executable, try: `chmod -x tests/client/__init__.py`
If on Windows, you may also need to: `git add --chmod=-x tests/client/__init__.py`
If it is supposed to be executable, double-check its shebang.
Command executed:
uv run --active pre-commit run --config .pre-commit-lite.yaml check-executables-have-shebangs --all-files🧠 Environment Info
| Key | Value |
|---|---|
| Version or commit | main |
| Runtime | Python 3.11+ |
| Platform / OS | macOS, Linux |
| Container | none |
🧩 Additional Context (optional)
The file tests/client/__init__.py should not have executable permissions. The recommended fix is to remove the executable bit:
chmod -x tests/client/__init__.py
git add --chmod=-x tests/client/__init__.pyThis is a common issue where files accidentally get marked as executable during development or when copying files between systems.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SHOULDP2: Important but not vital; high-value items that are not crucial for the immediate releaseP2: Important but not vital; high-value items that are not crucial for the immediate releasebugSomething isn't workingSomething isn't working