Skip to content

Conversation

@allendema
Copy link
Contributor

Modify files under /cinnamon-settings/ to use fstrings.
Did some tests locally but more tests are welcome.

Note:

  • no logic changes.
  • some edge cases are still left.

Versions:

note: no logic changes
note: some edge cases are still left
Signed-off-by: Allen <[email protected]>
@mtwebster
Copy link
Member

Hi, this is ok for non-translated strings, but the old format needs to be maintained for anything with gettext (_(), etc...)

@mtwebster mtwebster requested a review from Copilot November 14, 2025 17:05
Copilot finished reviewing on behalf of mtwebster November 14, 2025 17:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes Python string formatting by converting old-style % formatting and .format() calls to f-strings across the cinnamon-settings codebase. While the intention is good and most conversions are correct, there are 4 critical syntax errors that will cause the code to fail at runtime, and several instances of unnecessarily verbose format specifiers.

Key Issues Found:

  • 4 syntax errors that will break functionality (missing commas, missing braces, incorrect quote nesting)
  • 11 instances of unnecessary :d format specifiers for integers
  • 2 instances of redundant f-string usage

Reviewed Changes

Copilot reviewed 15 out of 23 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
xlet-settings.py Converted path construction and print statements to f-strings - looks good
cs_user.py Converted error message to f-string - looks good
cs_themes.py Converted theme path construction to f-strings - syntax error on line 872 (missing comma)
cs_startup.py Converted directory paths and error messages to f-strings - redundant formatting
cs_sound.py Converted markup and error messages to f-strings - syntax error on line 817 (missing braces)
cs_power.py Converted device descriptions and error messages to f-strings - looks good
cs_panel.py Converted debug print statements to f-strings - redundant format specifiers
cs_info.py Converted error messages to f-strings - looks good
cs_gestures.py Converted setting strings to f-strings and removed blank line - looks good
cs_extensions.py Converted directory path to f-string - looks good
cs_desklets.py Converted directory path to f-string - looks good
cs_default.py Converted markup and print statements to f-strings - syntax error on line 262 (missing braces)
cs_backgrounds.py Converted path construction and error messages to f-strings - syntax error on line 780 (quote nesting)
cs_applets.py Converted directory path to f-string - looks good
cinnamon-settings.py Converted timing output and application ID to f-strings - syntax errors and redundant specifiers
proxygsettings.py Converted proxy URL construction to f-strings - redundant format specifiers
imtools.py Converted error message to f-string - looks good
capi.py Converted paths and error messages to f-strings - looks good
Spices.py Converted file paths and error messages to f-strings - looks good
KeybindingWidgets.py Converted error messages to f-strings - looks good
JsonSettingsWidgets.py Converted error messages to f-strings - looks good
CinnamonGtkSettings.py Converted CSS rules and style properties to f-strings - redundant format specifiers
ChooserButtonWidgets.py Converted markup lambda to f-string - looks good

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mtwebster
Copy link
Member

mtwebster commented Nov 14, 2025

For the record, I had copilot do a review not because I value its coding knowledge and prowess (I don't, really) but it helps me when I do large sets of changes (especially repetitive things, refactoring) to catch careless detail things.

It looks like it found a number of things (I would have skimmed right past!). You should be able to get a re-review from it after you fix things (upper right corner of the page). If it's not offering you that option, let me know I'll trigger it.

@allendema
Copy link
Contributor Author

allendema commented Nov 14, 2025

@mtwebster mtwebster requested a review from Copilot November 15, 2025 15:55
Copilot finished reviewing on behalf of mtwebster November 15, 2025 15:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 15 out of 23 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mtwebster mtwebster merged commit 29478f8 into linuxmint:master Nov 16, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants