Skip to content

armbian-kernel: improve code documentation and formatting#9559

Open
igorpecovnik wants to merge 1 commit intomainfrom
cosmetics
Open

armbian-kernel: improve code documentation and formatting#9559
igorpecovnik wants to merge 1 commit intomainfrom
cosmetics

Conversation

@igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Mar 19, 2026

Summary

This PR improves the code documentation and formatting of the kernel configuration file lib/functions/compilation/armbian-kernel.sh.

  • Add comprehensive function documentation for all kernel config hooks
  • Add inline comments for all 311 kernel configuration options (opts_y, opts_n, opts_m, opts_val)
  • Align all inline comments to column 55 for visual consistency
  • Remove excessive blank lines between options for better density
  • Split multi-option lines into separate lines for better readability

Changes

File: lib/functions/compilation/armbian-kernel.sh

  • Enhanced documentation for functions like:

    • armbian_kernel_config__extrawifi_enable_wifi_opts_80211
    • armbian_kernel_config__enable_zram_support
    • armbian_kernel_config__select_nftables
    • armbian_kernel_config__enable_docker_support
    • And all other kernel configuration hooks
  • Added descriptive inline comments for every kernel config option

  • All comments aligned to column 55 (using tab width = 4)

  • File reduced from 1030 to 726 lines by removing excessive spacing

Test plan

  • Code review: verify documentation accuracy
  • Verify no functional changes (only formatting and comments)
  • Check that all kernel config options have descriptions

Summary by CodeRabbit

  • Chores
    • Improved documentation and clarified comments throughout kernel configuration processes for better code maintainability.

@igorpecovnik igorpecovnik requested a review from a team as a code owner March 19, 2026 10:23
@igorpecovnik igorpecovnik requested review from Tearran and dimitry-ishenko and removed request for a team March 19, 2026 10:23
@github-actions github-actions bot added 05 Milestone: Second quarter release size/large PR with 250 lines or more Needs review Seeking for review Framework Framework components labels Mar 19, 2026
- Add comprehensive function documentation for kernel config hooks
- Add inline comments for all kernel configuration options
- Align all inline comments to column 55 for consistency
- Remove excessive blank lines between options
- Split multi-option lines for better readability

Signed-off-by: Igor Pecovnik <igor@armbian.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

Updated inline documentation and formatting across kernel configuration hook functions in the Armbian kernel compilation module. Added kernel-context explanations and restructured comment blocks. Adjusted spacing in option array insertions and clarified two-phase flow comments in a utility function. No logic changes.

Changes

Cohort / File(s) Summary
Documentation and Formatting Updates
lib/functions/compilation/armbian-kernel.sh
Expanded inline documentation for Wi-Fi 802.11, NETKIT, eBPF/BTF, ZRAM, nftables/xtables, filesystem/Docker, GPIO sysfs, and NTSYNC configuration hooks. Reorganized and clarified comment blocks; adjusted spacing in option array assignments. Added explanatory commentary in armbian_kernel_config_apply_opts_from_arrays() describing two-phase flow without altering control logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hopping through the kernel comments, neat and clean,
Documentation blooms where code has been,
Spacing adjusted with a gentle touch,
No logic changed—we didn't alter much,
Just words arranged to help us understand,
This kernel compile patch, perfectly planned!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'armbian-kernel: improve code documentation and formatting' directly and accurately reflects the main changes: documentation improvements and formatting adjustments to the kernel configuration script.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cosmetics
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
lib/functions/compilation/armbian-kernel.sh (2)

69-69: Minor typo in comment.

The comment uses "lets" but should be "let's" (contraction of "let us").

📝 Suggested fix
-	opts_y+=("EXPERT")                                # Too many config options are hidden behind EXPERT=y, lets have it always on
+	opts_y+=("EXPERT")                                # Too many config options are hidden behind EXPERT=y, let's have it always on
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/functions/compilation/armbian-kernel.sh` at line 69, The comment on the
opts_y+=("EXPERT") line contains a typo: change "lets" to the contraction
"let's" so the comment reads "Too many config options are hidden behind
EXPERT=y, let's have it always on"; update the comment next to the EXPERT option
to use "let's" (reference: opts_y+=("EXPERT")).

120-120: Minor typo in comment.

The contraction "doesnt'" should be "doesn't" (apostrophe replaces the missing 'o').

📝 Suggested fix
-		# We don't disable the eBPF options, as eBPF itself doesn't require BTF (debug info) and doesnt' consume as much memory during build as BTF debug info does.
+		# We don't disable the eBPF options, as eBPF itself doesn't require BTF (debug info) and doesn't consume as much memory during build as BTF debug info does.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/functions/compilation/armbian-kernel.sh` at line 120, Fix the minor typo
in the comment inside armbian-kernel.sh: change "doesnt'" to the correct
contraction "doesn't" in the comment that reads "We don't disable the eBPF
options, as eBPF itself doesn't require BTF (debug info) and doesnt' consume as
much memory during build as BTF debug info does." to ensure proper spelling and
punctuation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@lib/functions/compilation/armbian-kernel.sh`:
- Line 69: The comment on the opts_y+=("EXPERT") line contains a typo: change
"lets" to the contraction "let's" so the comment reads "Too many config options
are hidden behind EXPERT=y, let's have it always on"; update the comment next to
the EXPERT option to use "let's" (reference: opts_y+=("EXPERT")).
- Line 120: Fix the minor typo in the comment inside armbian-kernel.sh: change
"doesnt'" to the correct contraction "doesn't" in the comment that reads "We
don't disable the eBPF options, as eBPF itself doesn't require BTF (debug info)
and doesnt' consume as much memory during build as BTF debug info does." to
ensure proper spelling and punctuation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ddf4c280-36d9-4c7f-9425-b015902098f9

📥 Commits

Reviewing files that changed from the base of the PR and between cb9509e and d30bd3c.

📒 Files selected for processing (1)
  • lib/functions/compilation/armbian-kernel.sh

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

Labels

05 Milestone: Second quarter release Framework Framework components Needs review Seeking for review size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

1 participant