WIP: show meaningful changes with ruff format #314

Closed
kparal wants to merge 1 commit from feature/306-2-ruff-reformat-important-changes into develop
Owner

See pyproject.toml changes

This is a temporary helper branch for #306 and #312

See pyproject.toml changes This is a temporary helper branch for #306 and #312
show meaningful changes with ruff format
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m45s
Run tests and linters / lint (pull_request) Failing after 3s
b13d6e39bf
See pyproject.toml changes
@ -410,0 +420,4 @@
action='store_true',
default=False,
help='Force check for missing blocker bugs after sync',
)
Author
Owner

Argparser definitions are another place where visual compactness is better for human consumption than splitting the values line by line. The original file with its custom wrapping was easier to read and search in.

Argparser definitions are another place where visual compactness is better for human consumption than splitting the values line by line. The original file with its custom wrapping was easier to read and search in.
Owner

I don't find this style less easy to read than custom wrapping, tbh. With the custom wrapping you have to look carefully how many arguments there are per line. With this you know there's one per line. This also gives you more space for your help text before you have to deal with wrapping a string across multiple lines...

I don't find this style less easy to read than custom wrapping, tbh. With the custom wrapping you have to look carefully how many arguments there are per line. With this you know there's one per line. This also gives you more space for your help text before you have to deal with wrapping a string across multiple lines...
@ -96,3 +110,2 @@
update_data['bugs'] = [
{'bugid': bug.bugid,
'type': [tp for tp in ACCEPTED_BUGTYPES if getattr(bug, tp)]}
{'bugid': bug.bugid, 'type': [tp for tp in ACCEPTED_BUGTYPES if getattr(bug, tp)]}
Author
Owner

This should probably receive the magic trailing comma for readability.

This should probably receive the magic trailing comma for readability.
@ -252,0 +302,4 @@
date_submitted=month_old_date,
stable_karma=0,
karma=-2,
)
Author
Owner

This seems like a clear regression to me. The original file as a nice flow and easy to read and parse with your eyes. Having it condensed is quite important when you want to cover all possible use cases and you need to visually see what is already covered and what it not. Splitting one of these lines arg-by-arg is a downgrade, because it breaks the pattern and prevents all the important info to fit on your screen.

In this case, it's testdata.py, a module for creating fake DB data. But the same situation will occur in testing/. You also need to specify lots of objects with lots of values, and vertical compactness of often more important in that case then individual arg values (they are often repeated over and over again anyway).

This seems like a clear regression to me. The original file as a nice flow and easy to read and parse with your eyes. Having it condensed is quite important when you want to cover all possible use cases and you need to _visually see_ what is already covered and what it not. Splitting one of these lines arg-by-arg is a downgrade, because it breaks the pattern and prevents all the important info to fit on your screen. In this case, it's `testdata.py`, a module for creating fake DB data. But the same situation will occur in `testing/`. You also need to specify lots of objects with lots of values, and vertical compactness of often more important in that case then individual arg values (they are often repeated over and over again anyway).
Owner

well, there's a few options then. If values are 'repeated over and over', that's an opportunity for improvement: could we e.g. use a functools.partial, or a wrapper for add_update, so we don't have to keep repeating those values over and over, and thus all the calls fit on one line?

well, there's a few options then. If values are 'repeated over and over', that's an opportunity for improvement: could we e.g. use a `functools.partial`, or a wrapper for `add_update`, so we don't *have* to keep repeating those values over and over, and thus all the calls fit on one line?
@ -49,0 +60,4 @@
],
'updateid': 'update1_for_bug_3000',
}
)
Author
Owner

I find these changes painful. What was an a short and readable code, is now very pretty and very long code. But in unit tests, prettiness is not your primary concern. Being able to process (and test) a lot of data is.

I find these changes painful. What was an a short and readable code, is now very pretty and very long code. But in unit tests, prettiness is not your primary concern. Being able to process (and test) a lot of data is.
Owner

I don't really mind these.

I don't really mind these.
Author
Owner

This is no longer needed, closing in favor of #312

This is no longer needed, closing in favor of #312
kparal closed this pull request 2026-06-08 14:03:09 +00:00
Some checks failed
Run tests and linters / test (pull_request) Successful in 2m45s
Run tests and linters / lint (pull_request) Failing after 3s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
quality/blockerbugs!314
No description provided.