Skip to content

Conversation

@ffranr
Copy link
Contributor

@ffranr ffranr commented Dec 9, 2025

  • Updated .golangci.yml to enforce a maximum line length of 80 characters.
  • Reformatted code comments and function parameters to adhere to the new line-length restriction.
  • Added nolint: lll comments where line wrapping was not applicable.

@ffranr ffranr self-assigned this Dec 9, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @ffranr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant improvement in code consistency and readability by enforcing an 80-character line length limit throughout the codebase. This change is implemented by configuring the lll linter in the project's .golangci.yml file, followed by a comprehensive reformatting of existing code to comply with this new standard. The strategic use of nolint:lll directives ensures that exceptions are handled gracefully without compromising the overall goal of cleaner, more maintainable code.

Highlights

  • Enforced 80-character line length: The .golangci.yml configuration has been updated to include and enforce a maximum line length of 80 characters using the lll linter.
  • Code reformatting for compliance: Numerous code comments, function parameters, and long string literals across various files have been reformatted by wrapping them to adhere to the newly enforced 80-character line length restriction.
  • Strategic use of nolint:lll comments: Where automatic line wrapping was not practical or desirable, // nolint: lll comments have been added to specific lines or blocks to suppress linter warnings and maintain readability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a line length limit of 80 characters and applies the necessary formatting changes across the codebase. The changes are mostly stylistic and look good. I've found a few minor inconsistencies in the formatting of nolint comments and have left suggestions to make them consistent.

@ffranr ffranr added the no-changelog This PR is does not require a release notes entry label Dec 9, 2025
Copy link
Member

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

i think maybe we should take this opportunity to use the same custom ll linter that LND uses? that way things work nicely for structured logging

- Replace the default `lll` with a custom `ll` linter, enabling
  configurable exclusions for specific `S` log lines.
- Integrate custom `ll` linter into the build system and `Makefile`.
- Include relevant test cases and configuration for `golangci-lint`.
- Replace occurrences of `// nolint:lll` with `// nolint:ll` across
  files for consistency.
- Reformat multiline strings, comments, and function parameters to
  improve clarity and adhere to style guidelines.
- Add `// nolint:ll` comments where necessary to prevent linter
  warnings.
@ffranr ffranr changed the title multi: enforce 80-char line length and add nolint:lll comments multi: enforce 80-char line length and add nolint:ll comments Dec 9, 2025
@ffranr
Copy link
Contributor Author

ffranr commented Dec 9, 2025

I've now added ll from LND.

Copy link
Member

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

thank you!! much appreciated 🚀

Copy link
Contributor

@ViktorT-11 ViktorT-11 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this @ffranr 🔥!!

Comment on lines +516 to +519
chanPoint, err =
firewalldb.HideChanPointStr(
ctx, tx, chanPoint,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we've used this pattern previously in litd, where you'd start the values on the right side of a = char on a new line. I'm ok with introducing it though, but I'm also in slight favour of just using nolint:ll for these types of lines. There's quite of few of these examples throughout the changed files.

I'll let you decide and I'm definitely ok with merging this as is if you think we should use this pattern :)!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not a big fan of the newline after = style. But I do think that in some cases its better than the alternative. It is used in tap and loop:
https://github.com/lightninglabs/loop/blob/f76c15ca16442b19b296b332ff77fb684729ecfa/staticaddr/withdraw/manager.go#L660-L664

So I think it should be ok for now. Thanks for the review!

@ffranr ffranr merged commit b1b75c8 into master Dec 12, 2025
22 checks passed
@ffranr ffranr deleted the lint-line-length branch December 12, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR is does not require a release notes entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants