Skip to content

Enhance Makefile terminal output and help layout#10636

Open
Euler-B wants to merge 1 commit intolightningnetwork:masterfrom
Euler-B:build/improve-makefile-ouput
Open

Enhance Makefile terminal output and help layout#10636
Euler-B wants to merge 1 commit intolightningnetwork:masterfrom
Euler-B:build/improve-makefile-ouput

Conversation

@Euler-B
Copy link
Copy Markdown
Contributor

@Euler-B Euler-B commented Mar 5, 2026

Change Description

This PR focuses on improving the Developer Experience (DX) when building and interacting with the lnd project via the terminal.

  1. Introducing a color-coded MSG macro to provide clear, easy-to-read status updates (e.g., [BUILD], [DOCS]).
  2. Refactoring the make help layout using a fixed-width awk formatter and Cyan-colored targets. This ensures proper text alignment and prevents long descriptions from overlapping the target names.

The terminal outputs:

Screenshot 1:
Captura desde 2026-03-05 18-19-47
Screenshot 2:
Captura desde 2026-03-05 18-21-09
Screenhot 3:
Captura desde 2026-03-05 18-21-49

Steps to Test

  1. Run any standard make command (e.g., make build) and observe that the terminal remains clean, showing only the color-coded status messages and the command's natural output.
  2. Run make help and observe the new formatted layout with cyan target names and fixed 30-character widths.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 significantly enhances the developer experience by improving the terminal output of make commands. It standardizes status messages with a new color-coded macro and revamps the make help display for clearer, more organized information, making it easier for developers to understand command execution and available options.

Highlights

  • Improved Terminal Output: Introduced a new color-coded MSG macro to provide clear and consistent status updates for various make commands (e.g., [BUILD], [DOCS]).
  • Enhanced make help Layout: Refactored the make help command's output to use a fixed-width awk formatter and cyan-colored target names, ensuring better text alignment and readability.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Makefile
    • Added new color variables BLUE and CYAN and updated GREEN and NC definitions for proper escape sequence handling.
    • Introduced a new MSG macro to standardize color-coded output for make commands.
    • Replaced direct print calls with the new MSG macro across various make targets, categorizing messages by type (e.g., INSTALL, BUILD, ITEST, DOCS, RELEASE, DOCKER, FLAKE, FUZZ, FMT, CHECK, LINT, RPC, SQLC, TEST, VENDOR, MOBILE, CLEAN, HELP).
    • Modified the help target's output formatting to use awk for fixed-width columns and apply CYAN color to target names for improved readability.
Activity
  • No specific human activity (comments, reviews) has been recorded for this pull request yet.
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.

@lightninglabs-deploy lightninglabs-deploy added the severity-low Best-effort review label Mar 5, 2026
Copy link
Copy Markdown

@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 aims to significantly improve the developer experience by enhancing the Makefile's terminal output, introducing a color-coded MSG macro, and refactoring the make help command. However, the implementation of the MSG and print macros introduces a critical shell command injection vulnerability due to the use of echo -e with unsanitized variables. Additionally, there are minor cosmetic issues in the output messages and a typo in the fuzz target that will cause a shell syntax error. It is strongly recommended to address the injection vulnerability by using printf with explicit format specifiers for safe message handling.

@Euler-B Euler-B force-pushed the build/improve-makefile-ouput branch from 1cb8c12 to 203b46f Compare March 6, 2026 14:20
Suppress the echo of internal shell commands by default to reduce
terminal noise during the build process. Maintain color-coded status
messages utilizing the MSG macro to provide clear section headers
and progress indicators.

Additionally, refactor the `make help` target to use a custom awk
formatter. This enforces a fixed
30-character width for target names
and highlights them in cyan, preventing description overlap and
improving overall readability.
@Euler-B Euler-B force-pushed the build/improve-makefile-ouput branch from 203b46f to 3eae600 Compare March 27, 2026 18:19
@lightninglabs-deploy
Copy link
Copy Markdown
Collaborator

@Euler-B, remember to re-request review from reviewers when ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

severity-low Best-effort review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants