Skip to content

Feat/add perform python linting - #6

Open
MohamedAliBouhaouala wants to merge 2 commits into
mainfrom
feat/add-perform-python-linting
Open

Feat/add perform python linting#6
MohamedAliBouhaouala wants to merge 2 commits into
mainfrom
feat/add-perform-python-linting

Conversation

@MohamedAliBouhaouala

Copy link
Copy Markdown
Contributor

🔧 Pre-commit Hook & Linting Automation Setup

The following PR sets up automated code formatting and linting for Python and YAML files using pre-commit. It includes configuration and tools to ensure consistent code style and quality across the codebase.

✅ Key Features

  • Pre-commit hooks to automatically run formatters and linters before every commit.
  • Auto-fixing support via black and isort.
  • Makefile commands for convenient manual linting when needed.

🗂️ Files & Configuration

  • .pre-commit-config.yaml
    Defines the list of hooks to run on staged files:

    • 🧹 Common checks (check-yaml, end-of-file-fixer, etc.)
    • 🐍 Python formatters/linters:
      • black
      • flake8
      • isort
      • pyupgrade
    • 📦 Also includes protolint for .proto files.
  • pyproject.toml
    Central configuration for:

    • flake8: linting rules, ignore list, max line length
    • black: line length and exclusions
    • isort: aligned with black’s style
  • Makefile
    Contains simple CLI commands to trigger pre-commit operations:

    make lint                   # Run all pre-commit hooks on all files
    make lint-changed-files     # Run hooks only on changed files
    make autoupdate             # Update pre-commit repo revisions
    make run-lint-hook hook=black  # Run a specific hook manually (black in this example)

yassinedorbozgithub

This comment was marked as resolved.

@yassinedorbozgithub yassinedorbozgithub left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀
image

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

Successfully merging this pull request may close these issues.

3 participants