Skip to content

[BE]Add Makefile and format fix script for tritonparse project #28

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

Closed
wants to merge 8 commits into from

Conversation

FindHao
Copy link
Member

@FindHao FindHao commented Jul 9, 2025

Add Linter and Formatting to CI Pipeline

Summary

This PR adds comprehensive code formatting and linting checks to the CI pipeline, ensuring consistent code quality across the project.

Key Changes

🔧 CI Integration

  • Added format-check job to .github/workflows/test.yml
  • Parallel execution: Format checks run before tests for faster feedback

🛠️ Formatting Tool Chain

  • Black: Primary code formatter (line-length: 88)
  • usort: Import sorting
  • Ruff: Linting only

📝 Configuration Updates

  • pyproject.toml: Configured black, usort, and ufmt settings
  • Makefile: Updated install-dev and lint commands
  • format_fix.py: Rewritten to use black for formatting, ruff for linting

Usage Commands

# Install development dependencies
make install-dev

# Fix all formatting issues
make format

# Check formatting (CI-compatible)
make lint-check

# Individual checks
make format-check  # Only check formatting

Test Plan

  • make format && make lint-check passes cleanly
  • ✅ CI pipeline runs format checks before tests
  • ✅ All formatting tools work consistently
% make format ; make lint-check
Running format fix script...
python -m tritonparse.tools.format_fix --verbose
Running usort for import sorting...
Running: usort format .
✅ usort completed
Running ruff for linting...
Running: ruff check . --fix
All checks passed!

✅ ruff linting completed
Running black for code formatting...
Running: black .
✅ black completed

🎉 All formatting tools completed successfully!
Checking linting...
ruff check --diff .
black --check --diff .
All done! ✨ 🍰 ✨
18 files would be left unchanged.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 9, 2025
@FindHao FindHao force-pushed the findhao/add_linter branch from 64b4035 to af11f1f Compare July 9, 2025 23:10
@FindHao FindHao changed the title Add Makefile and format fix script for tritonparse project [BE]Add Makefile and format fix script for tritonparse project Jul 10, 2025
@FindHao FindHao force-pushed the findhao/add_linter branch 2 times, most recently from 208addd to 6411f12 Compare July 10, 2025 23:19
@FindHao FindHao marked this pull request as ready for review July 10, 2025 23:40
@facebook-github-bot
Copy link
Contributor

@FindHao has imported this pull request. If you are a Meta employee, you can view this in D78130587.

@FindHao FindHao force-pushed the findhao/add_linter branch from 350f272 to 6d2a3c2 Compare July 11, 2025 02:36
@facebook-github-bot
Copy link
Contributor

@FindHao has imported this pull request. If you are a Meta employee, you can view this in D78130587.

@facebook-github-bot
Copy link
Contributor

@FindHao has imported this pull request. If you are a Meta employee, you can view this in D78130587.

@facebook-github-bot
Copy link
Contributor

@FindHao has imported this pull request. If you are a Meta employee, you can view this in D78130587.

@facebook-github-bot
Copy link
Contributor

@FindHao merged this pull request in 1e02e70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants