Python Prompts Free Prompt

Python Script to Check Python Code Style (PEP8)

Create a Python script that checks all Python files in a project for PEP8 compliance
☆ Save
Prompt
You are a Python developer. Write a script that uses pycodestyle or flake8 to check all .py files in a given directory for PEP8 violations. The script must: 1) Accept directory path, 2) Recursively scan all Python files, 3) Output a summary report with file names and line numbers of violations, 4) Provide an option to auto-format using autopep8 or black, 5) Ignore certain violations via config, 6) Integrate with pre-commit hooks, 7) Exit with non-zero code if violations found (for CI). Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.