neurogeriatricskiel / KielMAT

Python based toolbox for processing motion data
https://neurogeriatricskiel.github.io/KielMAT/
Other
6 stars 1 forks source link

Implement Pre-commit Hooks for Improved Code Quality and Consistency #58

Open JuliusWelzel opened 7 months ago

JuliusWelzel commented 7 months ago

Description

To maintain high standards of code quality and consistency in our codebase, I propose implementing pre-commit hooks. These hooks will automate checks and formatting tasks, ensuring all committed code follows our project guidelines. A key aspect of this proposal is the standardization of docstrings to follow the Google Python Docstring format.

Proposed Pre-commit Hooks

  1. Code Formatting (Black/Prettier): To ensure consistent code formatting across all contributions.
  2. Linting (flake8/ESLint): To detect coding errors, enforce coding standards, and identify potential bugs.
  3. Type Checking (mypy/TypeScript): For validating type annotations in our code.
  4. Dependency Checking: To keep track of outdated or insecure dependencies.
  5. Docstring Formatting: Enforces Google Python Docstring format for consistency and clarity in documentation.

Implementation Strategy

  1. Install Pre-commit Framework: Use the pre-commit framework for managing these hooks.
  2. Configure Hooks: Create a .pre-commit-config.yaml file to specify our chosen hooks.
  3. Integrate with Existing Workflow: Update our contribution guidelines to include steps for setting up pre-commit hooks locally.

Benefits