Conversation
WalkthroughUpdated CLI/help text for the -tl flag to state it lists templates matching current filters; internal template listing now sorts templates alphabetically by Path before applying filters and rendering. No public API signatures changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant C as CLI (main)
participant R as Runner
participant S as Store
U->>C: nuclei -tl [filters]
Note right of C: Help text updated to indicate filtered listing
C->>R: parse flags & request template list
R->>S: Templates()
S-->>R: []Template
Note over R: NEW: collect into slice and sort by Path (A→Z)
R->>R: apply current filters to sorted list
R-->>C: filtered, sorted template list
C-->>U: display templates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
internal/runner/templates.go (1)
47-51: Capture store.Templates() once and reuse
Assign the result ofstore.Templates()to a local variable, then sort and range over that to avoid repeated calls:- // order templates alphabetically by path - sort.Slice(store.Templates(), func(i, j int) bool { - return store.Templates()[i].Path < store.Templates()[j].Path - }) - - for _, tpl := range store.Templates() { + // order templates alphabetically by path + templates := store.Templates() + sort.Slice(templates, func(i, j int) bool { + return templates[i].Path < templates[j].Path + }) + + for _, tpl := range templates {This reduces function-call overhead in the comparator and loop.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
README.md(1 hunks)cmd/nuclei/main.go(1 hunks)internal/runner/templates.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.go: Format Go code using go fmt
Run static analysis with go vet
Files:
cmd/nuclei/main.gointernal/runner/templates.go
⏰ 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). (1)
- GitHub Check: Lint
🔇 Additional comments (2)
README.md (1)
166-166: LGTM! Clear documentation update.The updated description accurately reflects that the
-tlflag lists filtered templates rather than all available templates, improving user understanding of the flag's behavior.cmd/nuclei/main.go (1)
283-283: LGTM! Consistent help text update.The CLI help text now accurately describes that the
-tlflag lists templates matching current filters, consistent with the README documentation and the sorting behavior implemented ininternal/runner/templates.go.
|
will fix |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
internal/runner/templates.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.go: Format Go code using go fmt
Run static analysis with go vet
Files:
internal/runner/templates.go
⏰ 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). (3)
- GitHub Check: Tests (windows-latest)
- GitHub Check: Tests (macOS-latest)
- GitHub Check: Tests (ubuntu-latest)
|
idk why the integration tests are failing. Would you be so kind, @dogancanbakir, and look at it, please? |
|
@coderabbitai create an issue for this PR |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 1070 🏁 Script executed: Length of output: 7395 @Mzack9999, I can help create an issue for this PR. However, I need clarification on what the issue should track: Looking at the current status:
What would you like the issue to address?
Please let me know the focus and I'll create an appropriately titled and detailed issue assigned to you. |
|
@coderabbitai create an issue for this PR. The issue is about better flag description and templates sorting |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 54 @Mzack9999, I've created issue #6546 for this PR: #6546 The issue tracks both improvements:
The issue has been assigned to you as requested. |
Proposed changes
In this MR, I have added two things:
Checklist
Summary by CodeRabbit