Skip to content

Fix F541: replace f-strings with no placeholders in lightning tests#8929

Open
nikunjkumar05 wants to merge 1 commit intoElementsProject:masterfrom
nikunjkumar05:fix-bugs
Open

Fix F541: replace f-strings with no placeholders in lightning tests#8929
nikunjkumar05 wants to merge 1 commit intoElementsProject:masterfrom
nikunjkumar05:fix-bugs

Conversation

@nikunjkumar05
Copy link
Copy Markdown

@nikunjkumar05 nikunjkumar05 commented Mar 6, 2026

Changelog-None

About PR

This PR fixes flake8 F541 (f-strings missing placeholders) by replacing f-strings that contain no placeholders with plain strings in the lightning test files. These were lint errors only but reduce noise and avoid confusion.

Why

F541 indicates an f-string with no {} placeholders — likely a typo. Replacing with a plain string removes the lint error and clarifies intent.

How to Test

flake8 lightning/tests || true

Checklist

  • Changelog-None
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

@nikunjkumar05
Copy link
Copy Markdown
Author

@rustyrussell @daywalker90 @Lagrang3 please review my PR
thank you

@daywalker90
Copy link
Copy Markdown
Collaborator

You need to add "Changelog-None" to the PR or commit message. Otherwise looks good to me.

@nikunjkumar05
Copy link
Copy Markdown
Author

ok sir

@nikunjkumar05
Copy link
Copy Markdown
Author

@rustyrussell @daywalker90 @Lagrang3
Thank you for review
changes addressed sir please review the PR

@madelinevibes
Copy link
Copy Markdown
Collaborator

@nikunjkumar05 thanks for your contribution. You haven't replaced all of the possible F541 (f-strings missing placeholders). There are a lot of different files that have this dev string. We will holding off reviewing further until the PR has all of the replacements required.

@nikunjkumar05
Copy link
Copy Markdown
Author

Ok @madelinevibes thank you for review I will fix it shortly

@nikunjkumar05 nikunjkumar05 requested a review from cdecker as a code owner March 19, 2026 15:58
@madelinevibes
Copy link
Copy Markdown
Collaborator

great that you've had a review but now @nikunjkumar05 you need to update so the PR passes CI. Thanks!

@ShahanaFarooqui
Copy link
Copy Markdown
Collaborator

Hi @nikunjkumar05, I am not approving the workflow to run just yet. Since the last commit is guaranteed to fail CI, running it now would just waste build minutes. Let's get all those fixes in first.

@madelinevibes
Copy link
Copy Markdown
Collaborator

Please rebase (not merge!) and squash everything into one clean commit when you're done. It's quite messy right now. Thanks!

@nikunjkumar05
Copy link
Copy Markdown
Author

I think ready for review

@nikunjkumar05 nikunjkumar05 requested a review from cdecker March 23, 2026 18:20
@nikunjkumar05 nikunjkumar05 force-pushed the fix-bugs branch 3 times, most recently from a82f611 to bf5239f Compare March 24, 2026 09:41
@nikunjkumar05
Copy link
Copy Markdown
Author

Hi @madelinevibes ma’am, I believe the work is ready for review. Please let me know your feedback whenever you get a chance.

@madelinevibes madelinevibes added the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label Mar 25, 2026
@nikunjkumar05
Copy link
Copy Markdown
Author

@daywalker90 @madelinevibes any more modification needed please let me know ?

@madelinevibes
Copy link
Copy Markdown
Collaborator

@nikunjkumar05 can you re-base please? if possible, by the end of this week so we can add this to 26.06?
Release candidate planned for Monday 11 May.

@nikunjkumar05
Copy link
Copy Markdown
Author

@nikunjkumar05 can you re-base please? if possible, by the end of this week so we can add this to 26.06?
Release candidate planned for Monday 11 May.

Sure @madelinevibes

@nikunjkumar05
Copy link
Copy Markdown
Author

Done

Copy link
Copy Markdown
Collaborator

@daywalker90 daywalker90 left a comment

Choose a reason for hiding this comment

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

I also found one more f string that doesn't use a variable at tests/test_opening.py:2226:
f'result in a commitment_transaction without outputs'. Please fix that one as well.

After that run uv run make gen to check if your code changes the generated files (it should not!).

Also, the commit message needs a complete replacement. It should describe your overall changes made by this PR, not just the last step. Something like chore: degenerate f-strings with no placeholders to simple strings

Comment thread contrib/msggen/msggen/gen/grpc2py.py Outdated
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in node_pb2_grpc.py depends on'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a generated file, don't touch it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's still getting touched!

Comment thread contrib/msggen/msggen/gen/grpc/server.py Outdated
Comment thread contrib/msggen/msggen/gen/rpc/rust.py Outdated
#[serde(rename_all = "lowercase")]
pub enum Request {{
"""
.replace("{{", "{").replace("}}", "}"),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This will some day shoot us in the foot. Please remove this and replace the double brackets with single ones in place.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not resolved, read again.

@madelinevibes madelinevibes removed the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label May 4, 2026
@madelinevibes
Copy link
Copy Markdown
Collaborator

@nikunjkumar05 bringing your attention to Daywalker's review comments for resolution as soon as practicable so we can hopefully get this PR into 26.06!

@nikunjkumar05
Copy link
Copy Markdown
Author

nikunjkumar05 commented May 7, 2026

@nikunjkumar05 bringing your attention to Daywalker's review comments for resolution as soon as practicable so we can hopefully get this PR into 26.06!

Sure I will commit it as soon as possible ( before Monday)
Thank you

@nikunjkumar05 nikunjkumar05 force-pushed the fix-bugs branch 2 times, most recently from 8b87ad5 to 7bcf954 Compare May 7, 2026 12:15
@nikunjkumar05
Copy link
Copy Markdown
Author

nikunjkumar05 commented May 7, 2026

Hi @madelinevibes @daywalker90 can you please review the changes ?

if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in node_pb2_grpc.py depends on'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's still getting touched!

Comment thread contrib/msggen/msggen/gen/rpc/rust.py Outdated
#[serde(rename_all = "lowercase")]
pub enum Request {{
"""
.replace("{{", "{").replace("}}", "}"),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not resolved, read again.

@nikunjkumar05 nikunjkumar05 force-pushed the fix-bugs branch 3 times, most recently from 5df390f to 39a3b67 Compare May 8, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants