-
-
Notifications
You must be signed in to change notification settings - Fork 973
Improve clarity of scan module error message #1197
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: master
Are you sure you want to change the base?
Conversation
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughUpdated multiple localization YAMLs to simplify or rename Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
🔇 Additional comments (1)
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.
|
Thanks for the fix. Since you're doing this, there are other such messages as well which are not up to date or not clear enough. For example, we don't really have verbose mode |
|
Thanks for pointing that out! |
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: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nettacker/locale/bn.yaml (1)
90-96: Multiple translation keys lack consistent coverage across all locale files.The verification reveals significant inconsistencies in translation key distribution:
- Keys present only in English, Hindi, and Bengali (3 locales): show_all_profiles, single_process_started, start_multi_process, start_parallel_module_scan
- Keys with partial coverage (11-12 locales): no_scan_to_compare, compare_report_saved, build_compare_report, finish_build_report
- Keys with near-universal coverage (21-23 locales): software_version, start_api_server, time_to_sleep
The Bengali locale additions should include corresponding translations in the other 21+ locale files to ensure consistent user experience across all supported languages. Several translation keys are missing from many language files.
🤖 Fix all issues with AI agents
In @docs/Usage.md:
- Line 704: Remove the stray conversational sentence "Let me know if you have
any more questions." from the documentation; locate that exact phrase in the
Usage.md content and delete the line so the document ends with only technical,
objective content.
In @nettacker/locale/de.yaml:
- Line 75: The Chinese and Japanese locale files still use the old verbose range
text; update the verbose_mode entries in zh-cn.yaml and ja.yaml (key:
verbose_mode) to the simplified form used in other locales (remove the
“(0-5)”/default suffix), matching the same concise translation pattern as the
other language files so all locales are consistent.
In @nettacker/locale/it.yaml:
- Line 62: The Italian and Portuguese-Brazil locale files use the wrong key name
"verbose_level" which doesn't match the application's lookup ("verbose_mode"
used in nettacker/core/arg_parser.py via help=_("verbose_mode")); open
nettacker/locale/it.yaml and nettacker/locale/pt-br.yaml and rename the key
"verbose_level" to "verbose_mode" so the translation lookup aligns with the rest
of the locales and the code.
In @nettacker/locale/pt-br.yaml:
- Line 75: The locale key is inconsistent: replace the `verbose_level` key with
`verbose_mode` in the Portuguese-Brazil and Italian locale YAMLs so the runtime
lookup used by arg_parser.py, logger.py and config.py succeeds; open the pt-br
and it locale files, find any `verbose_level:` entries and rename them to
`verbose_mode:` (preserve the existing translated value) and run a quick grep
for `verbose_level` to ensure no stray occurrences remain.
🧹 Nitpick comments (1)
nettacker/locale/hi.yaml (1)
35-35: Simplification aligns with PR objectives.The removal of verbose level references (0-5 range, defaults) successfully addresses the reviewer's feedback about outdated messaging.
However, consider whether the help text should include a brief description of what verbose mode does, rather than just the label "वर्बज़ मोड". Compare with line 109 (
verbose_event) which provides descriptive text about the feature's purpose.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
docs/Usage.mdnettacker/locale/ar.yamlnettacker/locale/bn.yamlnettacker/locale/de.yamlnettacker/locale/el.yamlnettacker/locale/en.yamlnettacker/locale/es.yamlnettacker/locale/fa.yamlnettacker/locale/fr.yamlnettacker/locale/hi.yamlnettacker/locale/hy.yamlnettacker/locale/id.yamlnettacker/locale/it.yamlnettacker/locale/iw.yamlnettacker/locale/ko.yamlnettacker/locale/nl.yamlnettacker/locale/ps.yamlnettacker/locale/pt-br.yamlnettacker/locale/ru.yamlnettacker/locale/tr.yamlnettacker/locale/ur.yamlnettacker/locale/vi.yaml
✅ Files skipped from review due to trivial changes (3)
- nettacker/locale/ps.yaml
- nettacker/locale/ru.yaml
- nettacker/locale/ar.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
- nettacker/locale/en.yaml
🧰 Additional context used
📓 Path-based instructions (1)
docs/**
📄 CodeRabbit inference engine (AGENTS.md)
Place documentation under docs/
Files:
docs/Usage.md
🔇 Additional comments (18)
nettacker/locale/hi.yaml (1)
125-125: Clarify the purpose of this modification.The AI summary indicates this line shows a redundant modification with no meaningful change to the Hindi text. If this is accurate, consider whether this change is necessary or if it introduces unnecessary churn to the PR.
Can you confirm whether this line required modification, or if this is a whitespace/encoding-related change?
nettacker/locale/tr.yaml (2)
67-67: LGTM! Translation simplified appropriately.The updated translation correctly removes the outdated verbose level details (0-5) and default value, making the message clearer and more maintainable. The simplified "ayrıntılı mod" is accurate Turkish for "verbose mode."
175-175: Theall_verbose_levelandverbose_modeentries are distinct keys that coexist by design across all locale files. Line 175 in tr.yaml (all_verbose_level: ayrıntılı seviye) is not redundant with line 67 (verbose_mode: ayrıntılı mod)—they serve different configuration purposes and are consistently maintained together in all 20+ locale files. No update needed.Likely an incorrect or invalid review comment.
nettacker/locale/iw.yaml (1)
64-64: LGTM! Simplified verbose mode description.The change successfully removes the outdated verbose level range reference, aligning with the PR objectives to simplify user-facing messages.
nettacker/locale/vi.yaml (1)
68-68: LGTM! Updated to simplified verbose mode description.The Vietnamese translation now reads "enable verbose mode," which is consistent with the simplified approach across all locales and aligns with the PR's goal to remove outdated verbose level references.
nettacker/locale/ur.yaml (1)
70-70: LGTM! Simplified verbose mode label.The change removes the outdated level range specification and provides a cleaner user experience, consistent with the PR objectives.
nettacker/locale/el.yaml (1)
75-75: LGTM! Simplified verbose mode description.The Greek translation has been updated to remove the outdated level range specification, making the message clearer and consistent with the PR's objectives.
nettacker/locale/bn.yaml (2)
86-86: LGTM! Verbose event translation is clear.The Bengali translation for
verbose_eventappropriately describes enabling verbose output for thread status monitoring.
107-107: LGTM! Verbose mode description simplified.The
verbose_modetranslation has been appropriately simplified to "Verbose মোড" (Verbose mode), removing the outdated level range reference.nettacker/locale/es.yaml (1)
74-74: LGTM! Verbose mode description simplified.The Spanish translation for
verbose_modehas been appropriately simplified from "nivel de modo detallado (0-5) (valor predeterminado 0)" to "modo detallado", removing the outdated level range reference as intended by this PR.nettacker/locale/nl.yaml (1)
73-73: LGTM! Verbose mode description simplified.The Dutch translation for
verbose_modehas been appropriately simplified from "uitgebreid e niveau (0-5) (standaard 0)" to "uitgebreide modus", removing the outdated level range reference. This also corrects what appears to be a spacing issue in the original text.nettacker/locale/fr.yaml (1)
75-75: LGTM! Verbose mode description simplified.The French translation for
verbose_modehas been appropriately simplified from "niveau de mode verbeux (0-5) (par défaut 0)" to "mode verbeux", removing the outdated level range reference as intended by this PR.nettacker/locale/ko.yaml (1)
60-60: LGTM - Verbose mode description simplified appropriately.The removal of the outdated level range "(0-5) (default 0)" improves clarity and aligns with the PR's objective to clean up verbose mode references across locales.
nettacker/locale/id.yaml (1)
72-72: LGTM - Consistent verbose mode simplification.The change removes outdated level references and is consistent with the broader localization cleanup across the PR.
nettacker/locale/fa.yaml (1)
74-74: LGTM - Persian locale updated consistently.The verbose mode description has been appropriately simplified to remove outdated level references, consistent with other locales.
nettacker/locale/hy.yaml (1)
70-70: LGTM - Armenian locale updated appropriately.The verbose mode description simplification is consistent with the PR-wide cleanup effort.
docs/Usage.md (2)
54-54: LGTM - Verbose flag description improved.The simplified description "enable verbose output" is clearer and removes outdated level references, consistent with the locale file updates.
202-203: LGTM - Persian translation and formatting updated.The Persian verbose flag description has been updated to match the English simplification, and the added blank line improves readability in the RTL section.
| TYPE: ART | ||
| DESCRIPTION: BESCHREIBUNG | ||
| verbose_mode: Ausführlicher Modus (0-5) (Standard 0) | ||
| verbose_mode: Ausführlicher Modus |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that verbose_mode has been consistently updated across all locale files
# and that related references are addressed
echo "=== Checking verbose_mode entries across all locale files ==="
rg -n "^verbose_mode:" nettacker/locale/
echo -e "\n=== Checking for remaining verbose level range references (0-5) in locales ==="
rg -n "\(0-5\)" nettacker/locale/
echo -e "\n=== Checking all_verbose_level references that may need updating ==="
rg -n "all_verbose_level" nettacker/locale/
echo -e "\n=== Checking English locale for reference ==="
rg -n "verbose_mode:" nettacker/locale/en.yaml -A 0Repository: OWASP/Nettacker
Length of output: 2833
🏁 Script executed:
#!/bin/bash
# Check the German locale file structure around line 75
echo "=== German locale file around line 75 ==="
sed -n '70,80p' nettacker/locale/de.yaml
echo -e "\n=== Full German locale file line count ==="
wc -l nettacker/locale/de.yaml
echo -e "\n=== Check for any verbose level references in code (if applicable) ==="
fd -e py -e yaml | xargs grep -l "verbose_mode" | head -5Repository: OWASP/Nettacker
Length of output: 755
🏁 Script executed:
#!/bin/bash
# Check code implementation to see if verbose levels (0-5) are still supported
echo "=== Checking arg_parser for verbose mode implementation ==="
grep -n "verbose" nettacker/core/arg_parser.py | head -20
echo -e "\n=== Checking config.py for verbose handling ==="
grep -n "verbose" nettacker/config.py | head -15
echo -e "\n=== Check git status to see what locales were changed in this PR ==="
git log --oneline -1 --name-only 2>/dev/null | grep locale || echo "Git log not available"Repository: OWASP/Nettacker
Length of output: 1320
🏁 Script executed:
#!/bin/bash
# Let me check the exact state of these files and look for verbose level references
echo "=== Check if verbose levels are referenced anywhere in code ==="
rg "0-5" nettacker/ --type py --type yaml 2>/dev/null || echo "No matches found"
echo -e "\n=== Check verbose argument definition ==="
sed -n '1,100p' nettacker/core/arg_parser.py | grep -A 5 -B 5 "verbose" || trueRepository: OWASP/Nettacker
Length of output: 543
Fix incomplete locale updates: Chinese and Japanese not updated despite PR objective.
The German translation change is correct. However, the PR objective to "Remove outdated verbose level references" was incompletely executed. The Chinese (zh-cn.yaml line 58) and Japanese (ja.yaml line 58) locales still contain the outdated "(0-5)" range specifications:
- Chinese:
verbose_mode: 详细模式级别(0-5)(默认0) - Japanese:
verbose_mode: 冗両モードレベル(0〜5)(デフォルトは0)
All other locales (English, French, Spanish, German, Russian, Dutch, etc.) were successfully simplified. Update these two locales to match the pattern used in other languages.
🤖 Prompt for AI Agents
In @nettacker/locale/de.yaml at line 75, The Chinese and Japanese locale files
still use the old verbose range text; update the verbose_mode entries in
zh-cn.yaml and ja.yaml (key: verbose_mode) to the simplified form used in other
locales (remove the “(0-5)”/default suffix), matching the same concise
translation pattern as the other language files so all locales are consistent.
nettacker/locale/pt-br.yaml
Outdated
| TYPE: TIPO | ||
| DESCRIPTION: DESCRIÇÃO | ||
| verbose_level: nível de modo de detalhe (0-5) (padrão 0) | ||
| verbose_level: modo detalhado |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check which locale files use verbose_level vs verbose_mode
echo "=== Files using 'verbose_level:' ==="
rg -n "^verbose_level:" nettacker/locale/
echo ""
echo "=== Files using 'verbose_mode:' ==="
rg -n "^verbose_mode:" nettacker/locale/
echo ""
echo "=== Checking if both keys are referenced in code ==="
rg -n "verbose_level|verbose_mode" nettacker/ -g '!*.yaml' -g '!locale/' --type pyRepository: OWASP/Nettacker
Length of output: 2074
Fix key name inconsistency: Change verbose_level to verbose_mode.
The Brazilian Portuguese locale file uses the key verbose_level, but the codebase references only verbose_mode (arg_parser.py, logger.py, config.py). This causes the locale string lookup to fail, leaving Portuguese Brazilian users without the translated text. Two files are affected: pt-br.yaml and it.yaml. Both must use verbose_mode to match the code and all other locales.
🤖 Prompt for AI Agents
In @nettacker/locale/pt-br.yaml at line 75, The locale key is inconsistent:
replace the `verbose_level` key with `verbose_mode` in the Portuguese-Brazil and
Italian locale YAMLs so the runtime lookup used by arg_parser.py, logger.py and
config.py succeeds; open the pt-br and it locale files, find any
`verbose_level:` entries and rename them to `verbose_mode:` (preserve the
existing translated value) and run a quick grep for `verbose_level` to ensure no
stray occurrences remain.
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nettacker/locale/ja.yaml (1)
40-40: Update Japanese translation ofscan_method_selectto match English.The English locale has been updated to provide users with specific guidance:
No scan module specified. Use --show-all-modules to view available modules and select one using the -m option.The Japanese translation at line 40 remains generic (
あなたのスキャン方法を選んでください!— "Please select your scan method!") and does not convey the same helpful direction. Update the Japanese version to match the improved English message.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
docs/Usage.mdnettacker/locale/it.yamlnettacker/locale/ja.yamlnettacker/locale/pt-br.yamlnettacker/locale/zh-cn.yaml
✅ Files skipped from review due to trivial changes (1)
- nettacker/locale/zh-cn.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
- nettacker/locale/pt-br.yaml
- nettacker/locale/it.yaml
- docs/Usage.md
🔇 Additional comments (1)
nettacker/locale/ja.yaml (1)
58-58: LGTM! Verbose mode description simplified.The removal of outdated references to verbose mode levels (0-5) and default values aligns with the PR objectives to clean up unclear messaging.
Proposed change
This PR improves the user-facing error message shown when no scan module is specified.
The updated message provides clear guidance to list available modules using '--list-modules' and select one
using the
-moption, improving the first-time user experience.Type of change
Checklist
make pre-commit, it didn't generate any changesmake test, all tests passed locally