Your DevOps team uses AI-assisted generators to create Python helper scripts for Linux automation. To meet the code-linting best practice and prevent any commit that violates PEP 8 or introduces obvious logical errors from reaching the shared repository, you need an automated safeguard that still lets developers review their changes locally. Which approach BEST satisfies this requirement?
Configure a Git pre-commit hook that runs pylint and black, blocking the commit if violations are detected.
Use git rebase with the --squash option to condense AI-generated commits before merging.
Require all commits to be GPG-signed so the author can be verified by reviewers.
Enable Git Large File Storage (LFS) for the repository and review code style after each push.
Git supports a pre-commit hook that runs automatically before each commit is recorded. By wiring this hook to tools such as pylint-which checks PEP 8 style and detects likely coding mistakes-and a formatter like black, the commit is rejected until the problems are fixed. This forces developers (including those using AI-generated code) to verify and correct output before the code leaves their workstation, fulfilling the exam objective of code linting and the AI guideline of verify output. Enabling Git LFS only changes how large files are stored; it does not analyze code. Rebasing/squashing tidies history but does not lint. GPG signing confirms authorship but performs no style or logic checks.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a Git pre-commit hook?
Open an interactive chat with Bash
What does pylint and black do in code linting?
Open an interactive chat with Bash
What is PEP 8 and why is it important?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .