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

More Ruff fixes #1124

Merged
merged 1 commit into from
Jul 17, 2024
Merged

More Ruff fixes #1124

merged 1 commit into from
Jul 17, 2024

Conversation

SqAtx
Copy link
Contributor

@SqAtx SqAtx commented Jul 7, 2024

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.

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]
Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor Author

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))
Copy link
Contributor Author

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):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test was duplicated.

@diegogangl diegogangl added the maintainability Automated tests suite, tooling, refactoring, or anything that makes it easier for developers label Jul 17, 2024
@diegogangl
Copy link
Contributor

Looks good, thanks!

@diegogangl diegogangl merged commit ee101cc into getting-things-gnome:master Jul 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainability Automated tests suite, tooling, refactoring, or anything that makes it easier for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants