Skip to content

Set Up Linting, Formatting, and Pre-commit Hooks for Backend Codebase #236

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

medss19
Copy link
Member

@medss19 medss19 commented Jul 30, 2025

Description

Fixes #121

Provide a brief summary of the changes made to the website and the motivation behind them. Include any relevant issues or tickets.
This helps fast tracking your PR and merge it, Check the respective box below.

Fixes # (issue)

Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers/devices
  • My changes do not generate new console warnings or errors , I ran npm run build and attached scrrenshot in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

Summary

This PR introduces a complete linting and formatting pipeline for the backend Python codebase to ensure consistent code quality and style across contributions.

Included Tools

  • flake8 – Linting and PEP8 checks
  • black – Auto code formatter
  • isort – Import sorter
  • mypy – Static type checker
  • pre-commit – Local enforcement of rules
  • GitHub Actions – CI checks on pull requests

What's Done

  • Added .flake8, pyproject.toml, and mypy.ini for configurations
  • Added .pre-commit-config.yaml with hooks for black, flake8, isort, and mypy
  • Created requirements-dev.txt for development dependencies
  • Added GitHub Actions workflow .github/workflows/lint.yml to run checks on PRs
  • Updated README.md with setup and usage instructions

Benefits

  • Enforces consistent code style
  • Catches issues before they reach the main branch
  • Saves time on code review by automating quality checks
  • Improves developer experience

Copy link

vercel bot commented Jul 30, 2025

@medss19 is attempting to deploy a commit to the recode Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs.

In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to LinkedIn. Your contributions are highly appreciated!😊

Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging @sanjay-kv.

We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰

🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨

📚Your perks for contribution to this community 👇🏻

  1. Get free Consultation use code recode50 to get free: Mentorship for free.

  2. Get the Ebook for free use code recode at checkout: Data Science cheatsheet for Beginners.

  3. Check out this weekly Newsletter: Sanjay's Newsletter.

If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@medss19 medss19 requested a review from sanjay-kv July 31, 2025 03:49
@sanjay-kv
Copy link
Member

@medss19 this has been failed

- Fix setup-node action failing due to missing package-lock.json
- Generate package-lock.json with --legacy-peer-deps for Firebase compatibility
- Update CI workflow to use 'npm install --legacy-peer-deps' instead of 'npm ci'
- Simplify linting scope to JS/JSX files only for better reliability
- Update lint-staged configuration to process *.{js,jsx} files only
- Update npm scripts for format/format:check to target JS/JSX files
- Format existing JavaScript files with Prettier
- Enable CI pipeline caching and proper dependency resolution

Resolves: Dependencies lock file not found error in GitHub Actions
Copy link

vercel bot commented Aug 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
recode-website ❌ Failed (Inspect) Aug 4, 2025 10:49am

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.

Make a set of rule like lint check and script code checks
2 participants