bids-standard / legacy-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/bids-validator/
MIT License
185 stars 111 forks source link

feat: Build help text based on console width #2183

Closed effigies closed 13 hours ago

effigies commented 5 days ago

Closes bids-standard/bids-validator#11.

Just pushing to have the record here. Can merge and use a fork of cliffy or wait for https://github.com/c4spar/deno-cliffy/pull/761.

Before (regardless of terminal width): ``` ❯ deno run -A jsr:@bids/validator --help Usage: bids-validator Version: 1.14.13 Description: This tool checks if a dataset in a given directory is compatible with the Brain Imaging Data Structure specification. To learn more about Brain Imaging Data Structure visit http://bids.neuroimaging.io Options: -h, --help - Show this help. -V, --version - Show the version number for this program. --json - Output machine readable JSON -s, --schema - Specify a schema version to use for validation -c, --config - Path to a JSON configuration file -v, --verbose - Log more extensive information about issues --ignoreWarnings - Disregard non-critical issues --ignoreNiftiHeaders - Disregard NIfTI header content during validation --debug - Enable debug output (Default: "ERROR", Values: "NOTSET", "DEBUG", "INFO", "WARN", "ERROR", "CRITICAL") --filenameMode - Enable filename checks for newline separated filenames read from stdin --blacklistModalities - Array of modalities to error on if detected. (Default: [], Values: "MRI", "PET", "MEG", "EEG", "iEEG", "Microscopy", "NIRS", "MRS") -r, --recursive - Validate datasets found in derivatives directories in addition to root dataset -o, --outfile - File to write validation results to. --color, --no-color [color] - Enable/disable color output (defaults to detected support) (Default: true) ```
After (88 columns) ``` ❯ deno run -A ~/Projects/bids/bids-validator/bids-validator/src/bids-validator.ts --help Usage: bids-validator Version: v1.14.15-dev.0-11-g8f3519b3 Description: This tool checks if a dataset in a given directory is compatible with the Brain Imaging Data Structure specification. To learn more about Brain Imaging Data Structure visit http://bids.neuroimaging.io Options: -h, --help - Show this help. -V, --version - Show the version number for this program. --json - Output machine readable JSON -s, --schema - Specify a schema version to use for validation -c, --config - Path to a JSON configuration file -v, --verbose - Log more extensive information about issues --ignoreWarnings - Disregard non-critical issues --ignoreNiftiHeaders - Disregard NIfTI header content during validation --debug - Enable debug output (Default: "ERROR", Values: "NOTSET", "DEBUG", "INFO", "WARN", "ERROR", "CRITICAL") --filenameMode - Enable filename checks for newline separated filenames read from stdin --blacklistModalities - Array of modalities to (Default: [], error on if detected. Values: "MRI", "PET", "MEG", "EEG", "iEEG", "Microscopy", "NIRS", "MRS") -r, --recursive - Validate datasets found in derivatives directories in addition to root dataset -o, --outfile - File to write validation results to. --color, --no-color [color] - Enable/disable color (Default: true) output (defaults to detected support) ```
142 columns ``` ❯ deno run -A ~/Projects/bids/bids-validator/bids-validator/src/bids-validator.ts --help Usage: bids-validator Version: v1.14.15-dev.0-11-g8f3519b3 Description: This tool checks if a dataset in a given directory is compatible with the Brain Imaging Data Structure specification. To learn more about Brain Imaging Data Structure visit http://bids.neuroimaging.io Options: -h, --help - Show this help. -V, --version - Show the version number for this program. --json - Output machine readable JSON -s, --schema - Specify a schema version to use for validation -c, --config - Path to a JSON configuration file -v, --verbose - Log more extensive information about issues --ignoreWarnings - Disregard non-critical issues --ignoreNiftiHeaders - Disregard NIfTI header content during validation --debug - Enable debug output (Default: "ERROR", Values: "NOTSET", "DEBUG", "INFO", "WARN", "ERROR", "CRITICAL") --filenameMode - Enable filename checks for newline separated filenames read from stdin --blacklistModalities - Array of modalities to error on if detected. (Default: [], Values: "MRI", "PET", "MEG", "EEG", "iEEG", "Microscopy", "NIRS", "MRS") -r, --recursive - Validate datasets found in derivatives directories in addition to root dataset -o, --outfile - File to write validation results to. --color, --no-color [color] - Enable/disable color output (defaults to detected (Default: true) support) ```
codecov[bot] commented 5 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.48%. Comparing base (8f3519b) to head (3c48271). Report is 12 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master bids-standard/legacy-validator#2183 +/- ## ========================================== + Coverage 85.72% 87.48% +1.75% ========================================== Files 91 133 +42 Lines 3784 7056 +3272 Branches 1221 1671 +450 ========================================== + Hits 3244 6173 +2929 - Misses 454 788 +334 - Partials 86 95 +9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

effigies commented 13 hours ago

Will reopen on bids-validator