-
Notifications
You must be signed in to change notification settings - Fork 681
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 linter&formatter to Ruff, reformat codebase and fix some bugs #533
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that some lines of code exceed 80 characters, which violates Python's programming standards. Please ensure you run the pre-commit install
command before submitting your code (see CONTRIBUTION.md for details).
Additionally, I strongly recommend double-checking your code format before submitting the PR. I paused my review due to this issue, but once you confirm that it has been adjusted to meet Python standards in terms of formatting, please let me know and I will resume the review. Thank you for your understanding.
default_dataset_name = ( | ||
default_dataset | ||
if default_dataset in datasets.keys() | ||
else ordinary_datasets[0] | ||
if len(ordinary_datasets) > 0 | ||
else misalignment_datasets[0] | ||
if len(misalignment_datasets) > 0 | ||
else "" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the code block more readable as:
default_dataset_name = ( | |
default_dataset | |
if default_dataset in datasets.keys() | |
else ordinary_datasets[0] | |
if len(ordinary_datasets) > 0 | |
else misalignment_datasets[0] | |
if len(misalignment_datasets) > 0 | |
else "" | |
) | |
# Determine the default dataset name | |
if default_dataset in datasets: | |
default_dataset_name = default_dataset | |
elif ordinary_datasets: | |
default_dataset_name = ordinary_datasets[0] | |
elif misalignment_datasets: | |
default_dataset_name = misalignment_datasets[0] | |
else: | |
default_dataset_name = "" |
It is desired since we move the formatter to ruff. 88 is the default of black/ruff and yes many famous projects, including some python official standard libraries, have discarded the original line limit 79 from pep8 now. |
Thanks for your reply. Could you please update the contributing.md, since we use ruff? |
ebabd39
to
6ce1cd6
Compare
Just ask guohao and we decide to switch the character limit back to 80 as in google python guide. README.md is updated now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Hi @ocss884, could you please resolve all conversations before merging the PR in the future, whether you accept or reject the comments? This helps prevent any misunderstandings. Thanks a lot! :) |
close #509
The majority of changes are about formatting, except that
__init__
, use absolute import if they are under a same module.Opensourceconfig
which initializes instance variable with mutable dataclassGPT_3_5_TURBO
#532