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

Fix syntax error in completion file #1421

Merged
merged 1 commit into from
Nov 29, 2024
Merged

Conversation

Kemboiray
Copy link
Contributor

@Kemboiray Kemboiray commented Nov 28, 2024

A syntax error in the file caused the following output when trying to trigger completions in zsh (pressing TAB):

$ fastfetch    File "<stdin>", line 15
    command_prefix = f"--logo-color-{i}[{flag["desc"]} ({i})]"
                                               ^^^^
SyntaxError: f-string: unmatched '['

This fix replaces double quotes with single quotes in the f-strings in lines 29, 37 and 41.

A syntax error in the file caused the following output when trying to trigger completions in `zsh` (pressing <TAB>):

```zsh
$ fastfetch    File "<stdin>", line 15
    command_prefix = f"--logo-color-{i}[{flag["desc"]} ({i})]"
                                               ^^^^
SyntaxError: f-string: unmatched '['
```
This fix replaces single quotes with double quotes in the f-strings in lines 37 and 41.
@CarterLi
Copy link
Member

It's strange. Because the double quotes is inside of the braces, it should not be a problem.

@CarterLi
Copy link
Member

Tested myself

Python 3.13.0 (main, Oct  7 2024, 05:02:14) [Clang 16.0.0 (clang-1600.0.26.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> f = { "a": 2 }
>>> f"1{f["a"]}3"
'123'

@Kemboiray
Copy link
Contributor Author

My system uses Python 3.11. It seems that syntax is invalid in earlier versions of Python.

Python 3.11.0 (heads/3.11-dirty:2c3d839aab1, Mar  4 2024, 11:26:28) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> f = { "a": 2 }
>>> f"1{f["a"]}3"
  File "<stdin>", line 1
    f"1{f["a"]}3"
           ^
SyntaxError: f-string: unmatched '['

@CarterLi CarterLi merged commit 3004ce8 into fastfetch-cli:dev Nov 29, 2024
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