Repository: pre-commit/pre-commit-hooks

Issue #528: False positives raised by `check-executables-have-shebangs` in VS Code Dev Containers
Created: 2020-11-11T20:53:45Z
When developing within a container using VS Code's Dev Containers feature, the check-executables-have-shebangs raises false positives for staged files, see log below. When switching back to local development, the same check passes without issue.
Check that executables have shebangs.....................................Failed
- hook id: check-executables-have-shebangs
- exit code: 1

.devcontainer/devcontainer.json: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x .devcontainer/devcontainer.json`
  If it is supposed to be executable, double-check its shebang.
.cruft.json: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x .cruft.json`
  If it is supposed to be executable, double-check its shebang.
.vscode/settings.json: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x .vscode/settings.json`
  If it is supposed to be executable, double-check its shebang.
environment.run.yml: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x environment.run.yml`
  If it is supposed to be executable, double-check its shebang.

Duplicate issue #669: False positives with `check-executables-have-shebangs`
Created: 2021-10-15T15:25:24Z
Hi, I have got the check-executables-have-shebangs hook set up but it looks it's giving me false positives.
I am running the python:3.9-slim-bullseye docker image on an Apple M1 CPU.
Check that executables have shebangs.....................................Failed
- hook id: check-executables-have-shebangs
- exit code: 1

common/copy.py: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x common/copy.py`
  If it is supposed to be executable, double-check its shebang.
requirements/local.in: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x requirements/local.in`
  If it is supposed to be executable, double-check its shebang.
docker-compose.yaml: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x docker-compose.yaml`
  If it is supposed to be executable, double-check its shebang.
common/tests/test_filters.py: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x common/tests/test_filters.py`
  If it is supposed to be executable, double-check its shebang.
setup.cfg: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x setup.cfg`
  If it is supposed to be executable, double-check its shebang.
vaccinations/migrations/__init__.py: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: `chmod -x vaccinations/migrations/__init__.py`
  If it is supposed to be executable, double-check its shebang.
...

Closing comment (2021-10-15T15:27:51Z): dupe #528 docker/for-mac#5029