Skip to content

Commit 99f546d

Browse files
claude-codePaebbels
andcommitted
f-strings without placeholder are plain strings.
9 f-strings had no placeholder, so their 'f' prefix did nothing; 'f"…"' becomes '"…"', escaped braces '{{'/'}}' become '{'/'}'. Every string keeps its value. Fixed with CheckNeedlessFStrings (pyflakes F541). Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
1 parent c062e19 commit 99f546d

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎doc/conf.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@
209209
# Sphinx.Ext.ExtLinks
210210
# ==============================================================================
211211
extlinks = {
212-
"gh": (f"https://GitHub.com/%s", "%s"),
212+
"gh": ("https://GitHub.com/%s", "%s"),
213213
"ghissue": (f"https://GitHub.com/{githubNamespace}/{project}/issues/%s", "issue #%s"),
214214
"ghpull": (f"https://GitHub.com/{githubNamespace}/{project}/pull/%s", "pull request #%s"),
215215
"ghsrc": (f"https://GitHub.com/{githubNamespace}/{project}/blob/main/%s", None),
216216
"pypi": ("https://PyPI.org/project/%s", "%s"),
217-
"wiki": (f"https://en.wikipedia.org/wiki/%s", None),
217+
"wiki": ("https://en.wikipedia.org/wiki/%s", None),
218218
}
219219

220220

‎pyEDAA/ProjectModel/__init__.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,14 +433,14 @@ def __init__(self, path: pathlib_Path, vhdlLibrary: Union[str, 'VHDLLibrary'] =
433433
except KeyError as ex:
434434
raise Exception(f"VHDL library '{vhdlLibrary}' not found in default design '{project.DefaultDesign.Name}'.") from ex
435435
else:
436-
raise Exception(f"Can't lookup VHDL library because neither 'project' nor 'design' is given as a parameter.")
436+
raise Exception("Can't lookup VHDL library because neither 'project' nor 'design' is given as a parameter.")
437437
elif isinstance(vhdlLibrary, VHDLLibrary):
438438
self._vhdlLibrary = vhdlLibrary
439439
vhdlLibrary.AddFile(self)
440440
elif vhdlLibrary is None:
441441
self._vhdlLibrary = None
442442
else:
443-
ex = TypeError(f"Parameter 'vhdlLibrary' is neither a 'str' nor 'VHDLibrary'.")
443+
ex = TypeError("Parameter 'vhdlLibrary' is neither a 'str' nor 'VHDLibrary'.")
444444
ex.add_note(f"Got type '{getFullyQualifiedName(vhdlLibrary)}'.")
445445
raise ex
446446

@@ -917,11 +917,11 @@ def AddFile(self, file: File) -> None:
917917
raise TypeError("Parameter 'file' is not of type ProjectModel.File.")
918918
elif file._fileSet is not None:
919919
ex = ValueError(f"File '{file.Path!s}' is already part of fileset '{file.FileSet.Name}'.")
920-
ex.add_note(f"A file can't be assigned to another fileset.")
920+
ex.add_note("A file can't be assigned to another fileset.")
921921
raise ex
922922
elif file in self._set:
923923
ex = ValueError(f"File '{file.Path!s}' is already part of this fileset.")
924-
ex.add_note(f"A file can't be added twice to a fileset.")
924+
ex.add_note("A file can't be added twice to a fileset.")
925925
raise ex
926926

927927
self._files.append(file)
@@ -1254,7 +1254,7 @@ def AddDependency(self, library: 'VHDLLibrary') -> None:
12541254

12551255
def AddFile(self, vhdlFile: VHDLSourceFile) -> None:
12561256
if not isinstance(vhdlFile, VHDLSourceFile):
1257-
ex = TypeError(f"Parameter 'vhdlFile' is not a 'VHDLSourceFile'.")
1257+
ex = TypeError("Parameter 'vhdlFile' is not a 'VHDLSourceFile'.")
12581258
ex.add_note(f"Got type '{getFullyQualifiedName(vhdlFile)}'.")
12591259
raise ex
12601260

‎tests/unit/DependencyScan.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_VHDLLibrary(self) -> None:
7676
print(f"Loading design '{designA.Name}':")
7777
design = DOMDesign(name=designA.Name)
7878

79-
print(f" Loading default libraries (Std, Ieee, ...)")
79+
print(" Loading default libraries (Std, Ieee, ...)")
8080
design.LoadDefaultLibraries()
8181

8282
for libraryName, vhdlLibrary in designA.VHDLLibraries.items():
@@ -97,7 +97,7 @@ def test_VHDLLibrary(self) -> None:
9797

9898
design.AddDocument(vhdlDocument, lib)
9999

100-
print(f" Analyzing design ...")
100+
print(" Analyzing design ...")
101101
design.Analyze()
102102

103103
print()

0 commit comments

Comments
 (0)