landscape-graph
landscape-graph copied to clipboard
Fix: resolve code quality issues and minor bugs
Description: This PR addresses several easy to medium-level code quality issues identified during a repository audit.
Changes:
-
util/landgraph/landgraph.js:- Fixed a typo in the
outoption definition:typelabel->typeLabel. This ensures the help text displays correctly. - Fixed a logic error in the help condition. Previously
if (options.help || options)was always true. Changed toif (options.help || Object.keys(options).length === 0)to correctly show help only when requested or no options are provided.
- Fixed a typo in the
-
generate-entities.sh:- Added a missing comma after the
descriptionfield in the JMESPath query. This fixes a syntax error in the JSON projection.
- Added a missing comma after the
-
cleanup.sh:- Updated the
findandxargscommand to use-print0and-0respectively. This handles filenames with spaces or special characters correctly. - Removed the non-portable
-dflag fromfind. - Removed the unnecessary
{}placeholder fromxargs.
- Updated the
Impact: These changes improve the correctness, stability, and portability of the codebase. No existing functionality is altered or broken.
Verification:
- Verified syntax for all modified scripts.
- Confirmed
landgraph.jshelp logic now works as expected. - Confirmed
generate-entities.shquery syntax is valid. - Confirmed
cleanup.shcommand is syntactically correct and portable.
Checklist:
- [x] Changes do not break any existing functionality
- [x] Commit message follows DCO sign-off
- [x] Branch name follows conventions