flake8-executable (v2.1.3) is a Flake8 plugin designed to enforce best practices for executable files, checking for correct shebangs and file permissions. It integrates seamlessly with the Flake8 linter, providing automated checks that help maintain code quality and prevent common script execution issues. The library is actively maintained, with releases primarily focused on Python version compatibility and bug fixes.
Install & Compatibility
Where this runs
tested against v2.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.012s · 19.3MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 1.8s · import 0.008s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Users typically do not import flake8-executable directly; it's automatically loaded by Flake8. This import is mainly for programmatic version checking.
from flake8_executable import __version__
After installing `flake8-executable`, run `flake8` as you normally would. The plugin automatically integrates, checking for issues like missing shebangs (`EXE001`), incorrect shebangs (`EXE002`), or missing executable permissions (`EXE003`). The quickstart demonstrates how to install and run `flake8` with the plugin activated.
# 1. Install flake8 and flake8-executable
pip install flake8 flake8-executable
# 2. Create an example executable script (e.g., 'myscript.sh')
# Note: This file should be marked as executable (e.g., chmod +x myscript.sh)
# and have a shebang.
# Example 'myscript.sh' content:
# #!/bin/bash
# echo "Hello from a script!"
# 3. Run flake8 against your project
# It will automatically detect and use flake8-executable.
# Example with a specific file:
# flake8 myscript.sh
# Or to run on your current directory (assuming myscript.sh is there):
# flake8 .
# Expected output for a correctly configured script (no errors):
# (No output)
# If 'myscript.sh' had no shebang (EXE001) or wrong permissions (EXE003),
# flake8 would report it.
flake8 --version
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.