Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of Pre-Commit Hook for Code Quality and Consistency #268

Closed
endalkh opened this issue May 15, 2024 · 0 comments
Closed

Implementation of Pre-Commit Hook for Code Quality and Consistency #268

endalkh opened this issue May 15, 2024 · 0 comments

Comments

@endalkh
Copy link
Contributor

endalkh commented May 15, 2024

Objective:

  • To ensure code quality, consistency, and adherence to best practices by integrating a pre-commit hook that automates the execution of essential tools during the commit process.

Tools to be Integrated:

  • Black: For code formatting and styling
  • Isort: For maintaining consistent import order
  • Flake8: For static code analysis and linting
  • Django Migrations Check: To detect and prevent missing Django database migrations

Task Requirements:

  • Install Required Tools: Ensure that Black, Isort, Flake8, and Django are installed and available in the project's development environment.

  • Configure Pre-Commit Hook: Set up a pre-commit hook using a tool like pre-commit or husky to trigger the execution of the specified tools during the commit process.

  • Integrate Tools with Pre-Commit Hook: Configure the pre-commit hook to run the following tools in sequence:

    • Black: To format code according to the project's coding standards.
    • Isort: To organize imports in a consistent manner.
    • Flake8: To perform static code analysis and linting.
    • Django Migrations Check: To verify that all necessary Django database migrations are present and up-to-date.

Test Pre-Commit Hook:

  • Verify that the pre-commit hook is functioning correctly by attempting to commit code with intentional formatting issues, import inconsistencies, linting errors, or missing migrations.

Document Pre-Commit Hook Configuration: Maintain clear documentation on the pre-commit hook configuration, including the tools used, their versions, and any custom settings or configurations.

@endalkh endalkh closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant