Skip to content
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

Move the checkstyle to [Ruff](https://docs.astral.sh/ruff/) #483

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

Conversation

shivam15s
Copy link
Collaborator

@shivam15s shivam15s commented Dec 17, 2024

This PR has code contributed by Devin

Migration to Ruff

This PR migrates our code style tooling from flake8+isort+black to Ruff, which provides:

  • 10-100x faster linting and formatting
  • Drop-in replacement for all current tools
  • Built-in caching for better CI performance
  • Single configuration file in pyproject.toml

Changes

  • Added Ruff configuration in pyproject.toml maintaining current rules:
    • Line length: 120
    • Ignored rules: E501, B006, E731, A002, E203
    • Import sorting with isort compatibility
    • Black-compatible formatting
  • Updated Makefile checkstyle target to use Ruff
  • Removed obsolete .flake8 and .isort.cfg
  • Reformatted 112 files across the codebase:
    • Fixed import sorting and organization
    • Standardized import grouping (stdlib -> third-party -> local)
    • Maintained existing code style and formatting preferences
    • No logical code changes, only style improvements

Testing

  • Verified all changes locally:
    • make checkstyle passes successfully
    • Import sorting matches project conventions
    • Formatting maintains code readability
  • CI Status:
    • ✓ Checkstyle checks pass
    • ℹ️ Test failures are unrelated (Modal authentication issue)
    • No changes to code logic, only formatting changes

Note: The test failures in CI are due to missing Modal authentication tokens and are unrelated to this migration. The checkstyle checks pass successfully, confirming our formatting changes are correct.

Link to Devin run: https://app.devin.ai/sessions/efa14454ce01434d883d9394e3c525f8

devin-ai-integration bot and others added 6 commits December 17, 2024 02:19
- Replace flake8, isort, and black with Ruff
- Configure Ruff to maintain existing code style rules
- Update Makefile checkstyle target
- Remove obsolete config files

Co-Authored-By: byhsu@linkedin.com <byhsu@linkedin.com>
Co-Authored-By: byhsu@linkedin.com <byhsu@linkedin.com>
- Break multi-line imports into single lines
- Remove unnecessary blank lines after class/function definitions
- Maintain consistent formatting in nested structures
- Apply Ruff's import sorting rules across all directories

Co-Authored-By: byhsu@linkedin.com <byhsu@linkedin.com>
Co-Authored-By: byhsu@linkedin.com <byhsu@linkedin.com>
Co-Authored-By: byhsu@linkedin.com <byhsu@linkedin.com>
Co-Authored-By: byhsu@linkedin.com <byhsu@linkedin.com>
@ByronHsu
Copy link
Collaborator

Crazy

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.

2 participants