MarisiaS / SMM

0 stars 0 forks source link

BE-Set up pre-commit #9

Open MarisiaS opened 5 months ago

MarisiaS commented 5 months ago

Description

The current Django project lacks a pre-commit setup, leading to potential code quality issues and style inconsistencies. This issue aims to implement pre-commit hooks to automatically check and enforce coding standards before each commit

Posibles hooks

  1. black (code formatter) Automatically formats Python code to comply with the PEP 8 style guide. Helps maintain a consistent and readable codebase.

  2. Flake8 (linting tool) Checks for code style violations, potential errors, and enforces coding standards. Combines multiple linters, including PEP 8, PyFlakes, and McCabe complexity checker.

  3. isort (import sorter) Organizes and sorts imports in Python files. Helps maintain a consistent import order.

  4. Django Check (checks for common Django issues) Ensures that your Django project adheres to best practices and avoids common issues.

  5. pyupgrade (Modern Python) Automatically updates old-style Python syntax to new-style syntax.

  6. pre-commit-hooks (Miscellaneous checks) Various checks such as validating Python syntax, checking for valid JSON and YAML syntax, detecting debugger imports, and more.

  7. pylint (Python code analyzer) Analyzes Python code for potential errors, style violations, and duplicates.

MarisiaS commented 5 months ago

@viriponce I made a list of possible hooks, what do you think?

viriponce commented 5 months ago

@viriponce I made a list of possible hooks, what do you think?

It looks good, all these hooks sounds interesting. Let's try it :)