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

ref: Add ruff rules RUF #4001

Merged
merged 1 commit into from
Oct 4, 2024
Merged

ref: Add ruff rules RUF #4001

merged 1 commit into from
Oct 4, 2024

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Oct 3, 2024

Add ruff rules RUF

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 3, 2024
Comment on lines +198 to +207
"RUF006", # TODO (Store a reference to the return value of `asyncio.create_task`)
"RUF012", # TODO (Mutable class attributes should be annotated with `typing.ClassVar`)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At the moment I ignore these rules as they deserve some discussion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As for RUF012, there seems to be an issue in ruff not detecting pydantic models. Ruff should normally ignore pydantic models for this rule as pydantic does a deep copy of default objects.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4001.dmtpw4p5recq1.amplifyapp.com

@@ -53,7 +53,7 @@ def update_build_config(self, build_config: dotdict, field_value: Any, field_nam
# Add inputs to the build config
build_config = self.add_inputs_to_build_config(inputs, build_config)
except Exception as e:
logger.error(f"Error getting flow {field_value}: {str(e)}")
logger.error(f"Error getting flow {field_value}: {e}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we could use logger.exception here and remove the error from the message as it will be in the traceback ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree.

Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 3, 2024
@cbornet cbornet enabled auto-merge (squash) October 3, 2024 14:12
@cbornet cbornet force-pushed the ruff-rules-ruf branch 2 times, most recently from 8798c94 to 35342ab Compare October 3, 2024 14:59
@cbornet cbornet force-pushed the ruff-rules-ruf branch 6 times, most recently from c967c87 to ed87d64 Compare October 4, 2024 14:51
@cbornet cbornet merged commit 63beae1 into langflow-ai:main Oct 4, 2024
27 checks passed
@cbornet cbornet deleted the ruff-rules-ruf branch October 4, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants