Skip to content

Switch to Ruff from Black for formatting and linting#97

Merged
QuanMPhm merged 1 commit into
CCI-MOC:mainfrom
KelvinLinBU:precommit-update
Jun 9, 2025
Merged

Switch to Ruff from Black for formatting and linting#97
QuanMPhm merged 1 commit into
CCI-MOC:mainfrom
KelvinLinBU:precommit-update

Conversation

@KelvinLinBU

Copy link
Copy Markdown
Member

Closes #96. Switch from black to ruff-format as a pre-commit hook since it offers better performance and the groundwork for future linting enhancements like unused import detection and cleanup.

@KelvinLinBU KelvinLinBU requested a review from QuanMPhm May 15, 2025 15:27

@QuanMPhm QuanMPhm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just one comment

Comment thread .pre-commit-config.yaml Outdated
- repo: https://github.com/psf/black
rev: 24.4.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you use a more updated version of ruff? From their repo, is seems the latest is v11.

In fact, feel free to make a Dependabot PR as well (similar to this) so we won't need to be concerned about this. Please still update the version here though

@KelvinLinBU KelvinLinBU May 20, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sounds good. If we need to update this one, we'll need to update the invoicing ruff as well since this is pulled exactly from that.

@QuanMPhm QuanMPhm requested a review from knikolla May 20, 2025 15:34
We can move on from black pre-commit hook with ruff-format for better performance and the ability to point out unused imports.
if not dump_file:
raise Exception(
"Must provide either --sql_dump_file" "or --download_dump_from_s3."
"Must provide either --sql_dump_fileor --download_dump_from_s3."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not requesting a change to this PR, but it's funny that the linter caught a typo here. Feel free to make another PR to fix this typo

@KelvinLinBU KelvinLinBU May 28, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The linter is paying dividends already haha. I'll make a pr to fix the small typo once this is merged.

@QuanMPhm

Copy link
Copy Markdown
Collaborator

@knikolla This is ready for your review.

@QuanMPhm QuanMPhm merged commit 478223c into CCI-MOC:main Jun 9, 2025
3 checks passed
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.

Conversion from Black to Ruff for formatting and linting

3 participants