-
Notifications
You must be signed in to change notification settings - Fork 9
feat(lint-configs): Add symlink-rust-lint-configs.sh
to create symlinks for Rust lint configs.
#87
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughIntroduces a reusable symlink utility script and updates language-specific wrappers to delegate to it. Adds a new Rust wrapper. The C++ wrapper now calls the shared script for .clang-format and .clang-tidy. The utility validates input, resolves paths, computes relative paths, and manages symlink creation at the repo root. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant CPP as symlink-cpp-lint-configs.sh
participant RUST as symlink-rust-lint-configs.sh
participant CORE as symlink-config.sh
participant FS as Filesystem
Dev->>CPP: Run script
CPP->>CORE: symlink .clang-format
CORE->>FS: Validate paths, create/update symlink at repo root
FS-->>CORE: Result
CORE-->>CPP: Status/message
CPP->>CORE: symlink .clang-tidy
CORE->>FS: Validate paths, create/update symlink at repo root
FS-->>CORE: Result
CORE-->>CPP: Status/message
Dev->>RUST: Run script
RUST->>CORE: symlink .rustfmt.toml
CORE->>FS: Validate paths, create/update symlink at repo root
FS-->>CORE: Result
CORE-->>RUST: Status/message
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
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. Comment |
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: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
exports/lint-configs/symlink-config.sh
(1 hunks)exports/lint-configs/symlink-cpp-lint-configs.sh
(1 hunks)exports/lint-configs/symlink-rust-lint-configs.sh
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
exports/lint-configs/symlink-config.sh (1)
exports/lint-configs/symlink-cpp-lint-configs.sh (1)
main
(11-14)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: unit-tests (ubuntu-24.04)
- GitHub Check: unit-tests (ubuntu-22.04)
🔇 Additional comments (3)
exports/lint-configs/symlink-cpp-lint-configs.sh (1)
12-13
: LGTM: delegation to shared utility simplifies maintenance.Good move consolidating logic into symlink-config.sh.
exports/lint-configs/symlink-config.sh (1)
24-25
: Fix portability and broken-symlink handlingApply the diff to:
- replace
readlink -f
with arealpath … 2>/dev/null
fallback and abort on failure (macOS compatibility);- remove the extra slash in
src_path
;- refactor the symlink logic to handle broken links, missing files and mismatched targets.
Manually test on both macOS and Linux for:
- fresh creation
- already-correct symlink
- broken symlink at destination
- conflicting non-symlink file at destination
exports/lint-configs/symlink-rust-lint-configs.sh (1)
11-13
: No change needed for symlink script
The file exports/lint-configs/.rustfmt.toml exists, so the script correctly references.rustfmt.toml
.
Description
This PR depends on #86.
This PR adds a new script to create symlinks for Rust lint configs.
Checklist
breaking change.
Validation performed
Checked within this repo to ensure a symlink to
rustfmt.toml
lint config is properly created.Summary by CodeRabbit
New Features
Refactor
Chores