Skip to content

Make a set of rule like lint and python code run #121

@sanjay-kv

Description

@sanjay-kv

✅ Task Overview
To maintain consistent code style and ensure high-quality contributions, we need to introduce a set of linting and code quality rules for the backend Python codebase. This includes adding tools for linting, formatting, and static analysis.

🧰 Tools to Include
flake8 – for linting and checking PEP8 compliance

black – for auto code formatting

isort – for sorting imports

mypy – for static type checking

pre-commit – to enforce rules locally before commit

GitHub Actions – to run linting and tests on PRs
Implementation Steps
Set up a .flake8 config file with rules (e.g., max line length, ignore rules)

Set up pyproject.toml for black and isort configuration

Add mypy.ini or pyproject.toml for type checking

Add pre-commit config with all hooks:

black

flake8

isort

mypy

Add a requirements-dev.txt or update pyproject.toml with dev dependencies

Create a GitHub Actions workflow .github/workflows/lint.yml to run on PRs:

Run black --check

Run flake8

Run isort --check-only

Run mypy

Update README with setup instructions for local development:

How to install pre-commit

How to run linters locally

Metadata

Metadata

Labels

area:dev-envCI, pre-commit, pylint and other changes that do not change the behavior of the final code

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions