-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
The project would benefit from adding a pre-commit configuration to automatically perform checks and tasks before each commit. This can help maintain code quality and consistency throughout the project.
Motivation
Implementing a pre-commit configuration is essential for ensuring that code changes meet the project's quality standards and guidelines. It can help prevent common issues, such as linting errors, formatting inconsistencies, and failing tests, from being committed to the repository. This results in a cleaner and more reliable codebase.
Proposed Solution
- Install the
pre-commitpackage using pip or another package manager. - Create a
.pre-commit-config.yamlfile in the root directory of the project. - Define the hooks you want to run before each commit, such as code formatting (e.g., Black, Prettier), linting (e.g., flake8, pylint), and tests.
- Configure the pre-commit hooks according to the project's requirements and guidelines.
- Run
pre-commit installto set up the pre-commit hooks. - Update the
CONTRIBUTING.mdfile to inform contributors about the pre-commit setup and the checks they need to pass before submitting a pull request.
Additional Context
Integrating a pre-commit configuration streamlines the development process by ensuring that code changes are consistently formatted and checked before they are committed to the repository. This helps maintain a high level of code quality and reduces the time spent on code reviews and bug fixes.