-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
[Bug]: False positive with FURB184 #320
Comments
@shaolo1 thank you for opening this issue! I don't think this is a false positive, but perhaps the error message could be improved to better indicate what's going on. Because def test(self):
path = self.get_path() This might just be a MVP to illustrate the problem, in which case I can imagine this error is a bit misleading/confusing if you're intending to use |
Hi! I like this rule, but sometimes it can lead to a false positive. For example cases with a split definition of a template string and its formatting. template = '{}'
template.format('User') |
cc @sbrugman what are your thoughts on this? |
Fair enough. The original code that it was flagged in was a bit weird, and I just focused on the error message not making sense to me. In reality the original code really just needed changing, so perhaps a tweak to the message would be good enough. |
Fair enough. The original code that it was flagged in was a bit weird, and I just focused on the error message not making sense to me. In reality the original code really just needed changing, so perhaps a tweak to the message would be good enough. The net effect was positive and in the spirit of refurb. It prompted me to make a change to the code for the better. |
I just got this with the following code block after upgrading from v1.22.1 to v1.28.0 : m = chocolata.get_meta("Component")
+title_field = m.calculate_title()
data = chocolata.find_all(
"Component",
filters={
"target_entity": doc.doctype,
"is_identifier": True,
},
+ fields=["name", title_field],
order_by="creation asc",
)
# Note: order is important ^ to track matches
+notify({f"Component::{x['name']}": x[title_field] for x in data}) I've highlighted the relevant lines as to why this was a false positive |
Has your issue already been fixed?
master
branch? See the docs for instructions on how to setup a local build of Refurb.The Bug
The following code:
Emits the following error:
But it should not be emitting an error instance because...
There is nothing to chain here?
Version Info
Python Version
Python 3.11.3
Config File
# N/A
Extra Info
None
The text was updated successfully, but these errors were encountered: