-
-
Notifications
You must be signed in to change notification settings - Fork 0
docs: render licenses of deps in tables #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also generates tables for the dependencies of the bindings using the `cargo tree` command.
WalkthroughThe pull request modifies the Changes
Sequence DiagramsequenceDiagram
participant TG as TreeGetter
participant Cargo as Cargo Tree
participant Output as License File
TG->>Cargo: Execute cargo tree
Cargo-->>TG: Raw dependency output
TG->>TG: Process output with regex
TG->>TG: Format into structured table
TG->>Output: Write formatted license information
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (7)
docs/license_gen.py (7)
14-15
: Use descriptive naming for table headers.While
TABLE_HEADER
is straightforward, consider clarifying its usage in a brief docstring or inline comment for future maintainers.
27-31
: Consider unifying optional and binding table sections.Both
PY_BINDING_HEADER
andJS_BINDING_HEADER
reuseTABLE_HEADER
. It might be beneficial to unify similar references (like “## Bindings’ dependencies”) under a single pattern or function for maintainability and consistency.
33-35
: Add a description for Node.js binding.Similar to the Python binding, a short docstring or comment could clarify the reasoning for adding the Node.js binding section. This helps maintainers understand the broader context of these optional dependencies.
37-39
: Clarify purpose of SELF_DEP regex.A short inline comment explaining why
SELF_DEP
is necessary would make the code more self-documented. This helps future maintainers grasp its usage and potential edge cases.
55-57
: Do not overwrite arguments in place without context.
package
replaces the value inself.args[7]
withvalue
. To improve clarity, consider storing that string in a dedicated variable or explaining the index choice via comments. Hard-coded array indices can cause confusion ifself.args
changes.
58-77
: Extend license replacements for comprehensive coverage.The
get_output
method currently replaces only “MIT”, “Apache-2.0”, and “MPL-2.0”. Consider handling other well-known licenses or parametrize the method so new licenses can be easily extended in the future.
80-93
: Add optional debugging output or logging.When generating the MD file, consider a debug or verbose mode to print how many dependencies were found, or if the script encountered any anomalies. This may help future troubleshooting.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/license_gen.py
(2 hunks)
🔇 Additional comments (1)
docs/license_gen.py (1)
16-24
: Check for multiline string continuity.
The f-string uses a backslash at line 22. Verify that the final output includes all table rows as intended. Sometimes, trailing backslashes can introduce unwanted whitespace or escape errors.
This output is a little cleaner: https://cpp-linter-rs--91.org.readthedocs.build/en/91/other-licenses/ |
37cb281
to
059eae2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
bindings/node/README.md (1)
60-60
: Minor formatting suggestion for improved readabilityThe clarification about the package being non-binary is helpful. Consider hyphenating "platform-agnostic" for better readability.
-| `package.json` | Metadata about the npm package (platform agnostic - no binary). | +| `package.json` | Metadata about the npm package (platform-agnostic - no binary). |🧰 Tools
🪛 LanguageTool
[misspelling] ~60-~60: This word is normally spelled with a hyphen.
Context: ...json| Metadata about the npm package (platform agnostic - no binary). | |
cli.js` | The execut...(EN_COMPOUNDS_PLATFORM_AGNOSTIC)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
bindings/node/README.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
bindings/node/README.md
[misspelling] ~60-~60: This word is normally spelled with a hyphen.
Context: ...json| Metadata about the npm package (platform agnostic - no binary). | |
cli.js` | The execut...
(EN_COMPOUNDS_PLATFORM_AGNOSTIC)
🔇 Additional comments (3)
bindings/node/README.md (3)
56-56
: LGTM! Improved clarity about package type
The addition of "binary" to specify the package type provides better clarity about the nature of the npm packages.
62-63
: LGTM! Enhanced technical accuracy
The updated descriptions for both files are more precise and better explain their roles in the binary module ecosystem:
- index.d.ts: Clarifies that it contains both typing and documentation info
- index.js: Better explains its role in binary selection
64-64
: LGTM! Fixed grammar and improved clarity
The description now correctly explains the native module's naming convention and its relationship to the compilation target.
Also generates tables for the dependencies of the bindings using the
cargo tree
command.Summary by CodeRabbit
New Features
TreeGetter
class to manage dependency retrieval and documentation.Bug Fixes
Refactor