-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Summary
As the docs-agent project continues to mature, we should introduce automated code quality checks to ensure a consistent and professional codebase. Implementing pre-commit hooks will help us catch common issues - like formatting inconsistencies, trailing whitespace, and unused imports- before they are committed to the repository.
While we can look to projects like Kubeflow Pipelines for inspiration, a simple lightweight configuration that provides immediate value without over-complicating the development workflow would suffice initially.
Proposed Solution
We should implement a .pre-commit-config.yaml file with a foundational set of hooks.
Recommended Initial Hooks:
- Essential Sanitization:
trailing-whitespace,end-of-file-fixer, andcheck-yaml. - Code Formatting:
blackoryapfto ensure consistent Python style across all components. - Import Optimization:
isortto automatically sort imports (referencing the Google profile used in other Kubeflow projects). - Linting: A basic
flake8setup to catch obvious syntax errors or technical debt.
Implementation Plan
- Initialize a minimal
.pre-commit-config.yamlin the repository root. - Focus on the most impactful Python hooks (formatting and linting).
- Ensure the configuration is easy for new contributors to install (
pip install pre-commit && pre-commit install). - Run an initial pass on the existing codebase to normalize the current files.
Motivation
Adding even a basic pre-commit setup now will prevent mechanical "nitpicks" in code reviews and ensure that the project maintains a high standard of quality as it scales.
Checklist
- Add a simple
.pre-commit-config.yamlto the root. - Include standard hooks for whitespace, formatting, and imports.
- Verify the hooks run successfully on current files.
- Add basic instructions for contributors in the
README.mdorCONTRIBUTING.md.