Registry / testing / flake8-executable

flake8-executable

JSON →
library2.1.3pypypi✓ verified 35d ago

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.

testing
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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.012s · 19.3MB
glibc
py 3.103.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
Debug
Known footguns
breakingPython 3.6 support was dropped in v2.1.2. Users on Python 3.6 will need to upgrade their Python version or use an older version of flake8-executable (<2.1.2).
gotchaflake8-executable requires Flake8 to be installed and available in the same environment. It is a plugin, not a standalone tool. Running `flake8` without a working `flake8` installation will result in a 'command not found' or similar error.
gotchaFile detection for 'executable' can sometimes be broader than intended. For example, a file with a shebang but without executable permissions might still be flagged (EXE004) if it's not meant to be executable. Configure Flake8's `exclude` or `ignore` options in `pyproject.toml`, `setup.cfg`, or `.flake8` to manage these.
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.

Agent activity
14 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
script
1
Resources