Skip to content

Convert to f-strings#234

Open
zvecr wants to merge 1 commit into
masterfrom
fstrings
Open

Convert to f-strings#234
zvecr wants to merge 1 commit into
masterfrom
fstrings

Conversation

@zvecr

@zvecr zvecr commented Apr 22, 2026

Copy link
Copy Markdown
Member

Description

Currently the code base uses a mixture of f-strings and modulo Operator.

This can cause issues when user supplied config contains a %, and produces errors when expanding the strings.

@tzarc tzarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Dunno if these are anactual issue, but inconsistent compared to previous state.

Comment thread qmk_cli/git.py
git_cmd = ' '.join([s.replace(' ', r'\ ') for s in git_clone])

cli.log.error("Could not run '%s': %s: %s", git_cmd, e.__class__.__name__, e)
cli.log.error(f'Could not run "{git_cmd}": {e.__class__}: {e}')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
cli.log.error(f'Could not run "{git_cmd}": {e.__class__}: {e}')
cli.log.error(f'Could not run "{git_cmd}": {e.__class__.__name__}: {e}')

Comment thread qmk_cli/script_qmk.py
print(f'Warning: {qmk_firmware} does not end in "qmk_firmware". Do you need to set QMK_HOME to "{qmk_firmware}/qmk_firmware"?')

print('Error: %s: %s', (e.__class__.__name__, e))
print(f'Error: {e.__class__}: {e}')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
print(f'Error: {e.__class__}: {e}')
print(f'Error: {e.__class__.__name__}: {e}')

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