-
Notifications
You must be signed in to change notification settings - Fork 168
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
More Ruff fixes #1124
More Ruff fixes #1124
Conversation
Relates to getting-things-gnome#237 This is a follow-up to getting-things-gnome@c2f650f I ran `ruff check` and looked at the errors that Ruff finds but doesn't want to fix automatically. There are still 13 errors, which all seem to indicate a bug. They are mostly "Undefined name". I will fix them individually.
@@ -56,7 +56,6 @@ def copy(self, start, stop, bullet=None): | |||
if hasattr(ta, 'is_subtask'): | |||
is_subtask = True | |||
tid = ta.child | |||
tas = self.ds.tasks.lookup[tid] |
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 wasn't sure what the clipboard is supposed to do, so I didn't check whether there is a bug here.
Copy/pasting the contents of a task with subtasks doesn't show the subtasks as subtasks, just text. But that's also the behaviour in 0.6.
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.
Yeah, the clipboard is supposed to handle GTG content. That's probably an old bug
@@ -155,15 +155,12 @@ def get_colored_tags_markup(ds, tag_names): | |||
|
|||
def generate_tag_color(): | |||
|
|||
maxvalue = 1.0 |
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.
The original error was that maxvalue
is unused. The loop was written basically in C, so I wrote something more Pythonic. I checked that tag color generation still works.
@@ -149,6 +149,7 @@ def test_start(self): | |||
self.assertEqual(expected1, parse(text1)) | |||
self.assertEqual(expected1, parse(text2)) | |||
self.assertEqual(expected1, parse(text3)) | |||
self.assertEqual(expected2, parse(text4)) |
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.
expected2
and text4
were unused. Looking at them, I figured it was because of this missing assertion.
@@ -643,18 +643,6 @@ def test_simple_reverse_sort(self): | |||
self.assertEqual(task_store.data, expected) | |||
|
|||
|
|||
def test_simple_reverse_sort(self): |
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.
The test was duplicated.
Looks good, thanks! |
Relates to #237
This is a follow-up to c2f650f
I ran
ruff check
and looked at the errors that Ruff finds but doesn't want to fix automatically.There are still 13 errors, which all seem to indicate a bug. They are mostly "Undefined name". I will fix them individually.