12. GNAT SAS CLI Reference
12.1. gnatsas
12.1.1. NAME
gnatsas - GNAT Static Analysis Suite
12.1.2. SYNOPSIS
gnatsas [COMMAND] …
12.1.3. DESCRIPTION
Analyze a project with `gnatsas analyze -P project.gpr` and export the results with `gnatsas report -P project.gpr`. All `gnatsas` commands (listed below in the COMMANDS section) accept a `--help` switch to print more usage information.
Find a full reference, guide and tutorial in the GNAT SAS tab on: https://support.adacore.com/csm?id=documentation
12.1.4. COMMANDS
- analyze [OPTION]… [ARG]…
Analyze a project.
- baseline [OPTION]…
Modify baselines.
- help [--man-format=FMT] [OPTION]… [TOPIC]
Display GNATSAS help.
- report [COMMAND] …
Display results or generate a report in one of the supported formats once an analysis has been performed. If no format is specified, text format is applied.
- review [--from-csv=VAL] [--import=VAL] [OPTION]…
Review file interaction.
12.1.5. COMMON OPTIONS
These options are common to all commands.
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.1.6. MORE HELP
Use gnatsas COMMAND --help for help on a single command.
12.1.7. EXIT STATUS
gnatsas exits with the following status:
- 0
on success.
- 1
on internal tool error (e.g., analysis engine failure).
- 2
on user error (e.g., wrong option, options combination, incorrect option argument).
- 3
on setup error (e.g., missing read/write right for a file).
- 4
on parsing error.
- 100
on interruption (e.g., out of memory, user interruption).
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.1.8. BUGS
Open bug reports by visiting https://support.adacore.com/csm.
12.2. gnatsas-analyze
12.2.1. NAME
gnatsas-analyze - Analyze a project.
12.2.2. SYNOPSIS
gnatsas analyze [OPTION]… [ARG]…
12.2.3. DESCRIPTION
Analyze a project.
The default behavior (when none of -U, --no-subprojects, --file, --files-from is specified) is to analyze the closure of the main units specified in the GPRFILE project file for the full project tree, except externally built ones.
12.2.4. OPTIONS
- --bits=VAL
How many bits the analysis should assume.
- -f, --force
Force analysis of all files (disable incrementality).
- --file=VAL
Analyze a single file, ignoring other files from the project.
- --files-from=VAL
Specify the path of a file containing a list of files to analyze.
- --gnat
(Default) enable launching GNAT front end and collecting its warnings.
- --gnatcheck
(Default) enable GNATcheck analysis.
- --incrementality-method=VAL
Whether to use checksums or timestamps to determine files changes when performing SCIL generation or computing GNAT warnings.
- --infer
(Default) enable Infer analysis.
- --inspector
(Default) enable Inspector analysis.
- -j VAL, --jobs=VAL
Set maximum number of jobs. Set to 0 to let each analysis engine choose an optimal amount of cores.
- --keep-going
If set, do not stop on failure of an analysis engine, but only if all analysis engines fail.
- --mode=VAL
Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- --no-gnat
Disable launching GNAT front end and collecting its warnings.
- --no-gnatcheck
Disable GNATcheck analysis.
- --no-infer
Disable Infer analysis.
- --no-inspector
Disable Inspector analysis.
- --no-subprojects
Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- --no-unused-annotate-warning
Do not emit warnings about unused "Annotate" pragmas.
- --progress-bar=VAL
Print a progress bar.
- --run-name=VAL
Set an arbitrary name for this analysis run.
- --skip-spark-mode
If set, skip messages that are in 'SPARK mode On' code.
- --timeline=VAL
Timeline to use for the analysis.
- -U [FILE] (default=)
When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.2.5. COMMON OPTIONS
These options are common to all commands.
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE (required)
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.2.6. MORE HELP
Use gnatsas COMMAND --help for help on a single command.
12.2.7. EXIT STATUS
analyze exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.2.8. BUGS
Open bug reports by visiting https://support.adacore.com/csm.
12.2.9. SEE ALSO
gnatsas(1)
12.3. gnatsas-baseline
12.3.1. NAME
gnatsas-baseline - Modify baselines.
12.3.2. SYNOPSIS
gnatsas baseline [OPTION]…
12.3.3. DESCRIPTION
Modify baselines.
12.3.4. OPTIONS
- --bump-baseline
Bump baseline.
- --set-baseline=VAL
Specify that sam_file is the new default baseline.
- --set-current=VAL
Set sam_file as the results of the last run. Let the user import results as if they were produced locally.
- --timeline=VAL
Timeline to use for the baseline.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.3.5. COMMON OPTIONS
These options are common to all commands.
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE (required)
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.3.6. MORE HELP
Use gnatsas COMMAND --help for help on a single command.
12.3.7. EXIT STATUS
baseline exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.3.8. BUGS
Open bug reports by visiting https://support.adacore.com/csm.
12.3.9. SEE ALSO
gnatsas(1)
12.4. gnatsas-help
12.4.1. NAME
gnatsas-help - Display GNATSAS help.
12.4.2. SYNOPSIS
gnatsas help [--man-format=FMT] [OPTION]… [TOPIC]
12.4.3. DESCRIPTION
Prints help about gnatsas commands and other subjects…
12.4.4. ARGUMENTS
- TOPIC
The topic to get help on. topics lists the topics.
12.4.5. OPTIONS
- --man-format=FMT (absent=pager)
Show output in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
12.4.6. COMMON OPTIONS
These options are common to all commands.
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.4.7. MORE HELP
Use gnatsas COMMAND --help for help on a single command.
12.4.8. EXIT STATUS
help exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.4.9. BUGS
Open bug reports by visiting https://support.adacore.com/csm.
12.4.10. SEE ALSO
gnatsas(1)
12.5. gnatsas-report
12.5.1. NAME
gnatsas-report - Display results or generate a report in one of the supported formats once an analysis has been performed. If no format is specified, text format is applied.
12.5.2. SYNOPSIS
gnatsas report [COMMAND] …
12.5.3. DESCRIPTION
Display results of an analysis.
12.5.4. COMMANDS
- code-climate [OPTION]… [FILE.sam]
Display results in Code Climate format.
- csv [OPTION]… [FILE.sam]
Display results in CSV format.
- exit-code [OPTION]… [FILE.sam]
Count messages and exit with the result as exit code. Count all the messages that are not info or annotation by default. You can use --show to specify which messages to count.
- gnat-studio [OPTION]… [FILE.sam]
Generate report for GNAT Studio.
- gnathub [OPTION]… [FILE.sam]
Generate report for GNAThub.
- html [OPTION]… [FILE.sam]
Generate an HTML report.
- sarif [OPTION]… [FILE.sam]
Generate report in SARIF format.
- security [OPTION]… [FILE.sam]
Generate a security report.
- text [OPTION]… [FILE.sam]
Display results in text format.
12.5.5. ARGUMENTS
- FILE.sam
[Optional] Specify a SAM file from which to generate a report. This can be used 1) in addition to a GPR project file specified with -P or 2) instead of such specification. In case 1), this can be used to generate a report from an arbitrary SAM file, whereas the one from the latest analysis (or corresponding to the specified timeline) is used otherwise. In case 2), the report format must be explicitly provided (e.g. 'text') and only the following formats are supported: [text, csv, exit-code, security, gnathub]. This can be useful in workflows where the project dependencies are not available in the environment. Note that options (such as filters) specified in the project file will not apply in such case and should be passed to the command-line if required.
12.5.6. OPTIONS
- --compare-with=VAL
Specify a SAM file for a one-off comparison with the selected analysis run (the last run of the specified timeline, or the current run if no timeline was specified).
- -o FILE, --out=FILE
File in which the report should be written. '-' means standard output.
- --show=VAL
Selectively hide or show messages according to the tool that emitted them, what they're about, the file or project they come from or whether they're new or not. See the SHOW OPTION FORMATTING section of the "gnatsas report --help" documentation page for detailed format of this option. Specifying this switch multiple times performs a union of the results of each filter.
- --show-backtraces
Show backtraces.
- --show-header
Add header to output
- --show-reviews
Print review information, if any, alongside the messages. This prints the current review status, date of review, name of reviewer and associated comment.
- --timeline=VAL
Timeline to use for the report.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.5.7. COMMON OPTIONS
These options are common to all commands.
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.5.8. SHOW OPTION FORMATTING
This section desribes the format of the value to pass to the report command's --show option in order to filter messages. Its format is:
--show [default|all|category_constraint]{,category_constraint}*
If all is specified, the default constraints are ignored and only the specified ones are applied. Otherwise, if nothing (or default) is specified, specified constraints are added to the default ones.
category_constraint's format is: category[=[all|default]|[=|+|-]constraint]{[+|-]constraint}*
Using = resets the constraints of the corresponding category while + (resp. -) adds them to (resp. removes them from) the previous ones, if any.
The category is one of age, kind, rank, tool, cwe, review_status, review_kind, prj or file.
The constraint depends on category:
- age
constraints are: unchanged, added and removed
- kind
constraints are: warning, check, info, race_condition, annotation and all message kinds. Spaces in message kinds must be replaced with underscores (e.g. "access check" must be specified as "access_check")
- rank
constraints are info, low, medium and high
- tool
constraints are inspector, infer, gnatcheck and gnat
- cwe
constraints are any CWE or none
- review_status
constraints are all review statuses plus none
- review_kind
constraints are not_a_bug, pending, bug, uncategorized and none
- prj
constraints are runtime and any project basename, or relative paths
- file
constraints are source files basename, or relative paths
If a constraint contains one of the characters ',', '-', '+' or '=', this character should be quoted or escaped.
For cwe, review_status and review_kind, none matches those messages that do not have the corresponding information attached (i.e., no cwe and no review, respectively).
12.5.9. SHOW OPTION DEFAULT VALUE
- The default filter for the text, code-climate and exit-code formats is equivalent to:
--show age=added+unchanged,kind=all-annotation-info,review_kind=all-not_a_bug
- The default filter for csv and sarif formats is equivalent to:
--show kind=all-annotation-info
Other formats do not have any filtering. Refer to the User Guide for more information about default filtering.
12.5.10. SHOW OPTION EXAMPLES
- Adding info messages to default output:
--show kind+info
- Adding annotations to default output:
--show kind+annotation
- Hiding messages with low rank from default output:
--show rank-low
- Showing all messages:
--show all
- Showing only warnings and checks:
--show all,kind=warning+check
- Showing only added messages:
--show all,age=added
- Showing only added high messages with no user review:
--show all,age=added,rank=high,review_status=none
- Showing only messages from file a-b.adb:
--show 'file="a-b.adb"'
- Showing all Infer messages and only high Inspector messages:
--show tool=inspector,rank=high --show tool=infer
12.5.11. MORE HELP
Use gnatsas COMMAND --help for help on a single command.
12.5.12. EXIT STATUS
report exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.5.13. BUGS
Open bug reports by visiting https://support.adacore.com/csm.
12.5.14. SEE ALSO
gnatsas(1)
12.6. gnatsas-review
12.6.1. NAME
gnatsas-review - Review file interaction.
12.6.2. SYNOPSIS
gnatsas review [--from-csv=VAL] [--import=VAL] [OPTION]…
12.6.3. DESCRIPTION
Review file interaction.
12.6.4. OPTIONS
- --from-csv=VAL
Import reviews from specified csv file
- --import=VAL
Import reviews from specified review file
12.6.5. COMMON OPTIONS
These options are common to all commands.
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE (required)
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.6.6. MORE HELP
Use gnatsas COMMAND --help for help on a single command.
12.6.7. EXIT STATUS
review exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.6.8. BUGS
Open bug reports by visiting https://support.adacore.com/csm.
12.6.9. SEE ALSO
gnatsas(1)
12.7. gnatsas-report-code-climate
12.7.1. NAME
gnatsas-report-code-climate - Display results in Code Climate format.
12.7.2. SYNOPSIS
gnatsas report code-climate [OPTION]… [FILE.sam]
12.7.3. ARGUMENTS
- FILE.sam
[Optional] Specify a SAM file from which to generate a report. This can be used 1) in addition to a GPR project file specified with -P or 2) instead of such specification. In case 1), this can be used to generate a report from an arbitrary SAM file, whereas the one from the latest analysis (or corresponding to the specified timeline) is used otherwise. In case 2), the report format must be explicitly provided (e.g. 'text') and only the following formats are supported: [text, csv, exit-code, security, gnathub]. This can be useful in workflows where the project dependencies are not available in the environment. Note that options (such as filters) specified in the project file will not apply in such case and should be passed to the command-line if required.
12.7.4. OPTIONS
- --compare-with=VAL
Specify a SAM file for a one-off comparison with the selected analysis run (the last run of the specified timeline, or the current run if no timeline was specified).
- --long-desc
Include check name and engine name at the beginning of the description. This is not required by the format but provides more information in CodeClimate viewers with limited display capabilities.
- -o FILE, --out=FILE
File in which the report should be written. '-' means standard output.
- --root=DIR
Make the paths in the codeClimate files relative to DIR instead of the project directory. This is typically used to specify the root of the Git repository in order to generate a report for a GitLab integration.
- --show=VAL
Selectively hide or show messages according to the tool that emitted them, what they're about, the file or project they come from or whether they're new or not. See the SHOW OPTION FORMATTING section of the "gnatsas report --help" documentation page for detailed format of this option. Specifying this switch multiple times performs a union of the results of each filter.
- --timeline=VAL
Timeline to use for the report.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.7.5. COMMON OPTIONS
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE (required)
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.7.6. EXIT STATUS
code-climate exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.7.7. SEE ALSO
gnatsas(1)
12.8. gnatsas-report-csv
12.8.1. NAME
gnatsas-report-csv - Display results in CSV format.
12.8.2. SYNOPSIS
gnatsas report csv [OPTION]… [FILE.sam]
12.8.3. ARGUMENTS
- FILE.sam
[Optional] Specify a SAM file from which to generate a report. This can be used 1) in addition to a GPR project file specified with -P or 2) instead of such specification. In case 1), this can be used to generate a report from an arbitrary SAM file, whereas the one from the latest analysis (or corresponding to the specified timeline) is used otherwise. In case 2), the report format must be explicitly provided (e.g. 'text') and only the following formats are supported: [text, csv, exit-code, security, gnathub]. This can be useful in workflows where the project dependencies are not available in the environment. Note that options (such as filters) specified in the project file will not apply in such case and should be passed to the command-line if required.
12.8.4. OPTIONS
- --compare-with=VAL
Specify a SAM file for a one-off comparison with the selected analysis run (the last run of the specified timeline, or the current run if no timeline was specified).
- -o FILE, --out=FILE
File in which the report should be written. '-' means standard output.
- --show=VAL
Selectively hide or show messages according to the tool that emitted them, what they're about, the file or project they come from or whether they're new or not. See the SHOW OPTION FORMATTING section of the "gnatsas report --help" documentation page for detailed format of this option. Specifying this switch multiple times performs a union of the results of each filter.
- --timeline=VAL
Timeline to use for the report.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.8.5. COMMON OPTIONS
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.8.6. EXIT STATUS
csv exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.8.7. SEE ALSO
gnatsas(1)
12.9. gnatsas-report-exit-code
12.9.1. NAME
gnatsas-report-exit-code - Count messages and exit with the result as exit code. Count all the messages that are not info or annotation by default. You can use --show to specify which messages to count.
12.9.2. SYNOPSIS
gnatsas report exit-code [OPTION]… [FILE.sam]
12.9.3. ARGUMENTS
- FILE.sam
[Optional] Specify a SAM file from which to generate a report. This can be used 1) in addition to a GPR project file specified with -P or 2) instead of such specification. In case 1), this can be used to generate a report from an arbitrary SAM file, whereas the one from the latest analysis (or corresponding to the specified timeline) is used otherwise. In case 2), the report format must be explicitly provided (e.g. 'text') and only the following formats are supported: [text, csv, exit-code, security, gnathub]. This can be useful in workflows where the project dependencies are not available in the environment. Note that options (such as filters) specified in the project file will not apply in such case and should be passed to the command-line if required.
12.9.4. OPTIONS
- --compare-with=VAL
Specify a SAM file for a one-off comparison with the selected analysis run (the last run of the specified timeline, or the current run if no timeline was specified).
- --show=VAL
Selectively hide or show messages according to the tool that emitted them, what they're about, the file or project they come from or whether they're new or not. See the SHOW OPTION FORMATTING section of the "gnatsas report --help" documentation page for detailed format of this option. Specifying this switch multiple times performs a union of the results of each filter.
- --timeline=VAL
Timeline to use for the report.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.9.5. COMMON OPTIONS
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.9.6. EXIT STATUS
exit-code exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.9.7. SEE ALSO
gnatsas(1)
12.10. gnatsas-report-html
12.10.1. NAME
gnatsas-report-html - Generate an HTML report.
12.10.2. SYNOPSIS
gnatsas report html [OPTION]… [FILE.sam]
12.10.3. ARGUMENTS
- FILE.sam
[Optional] Specify a SAM file from which to generate a report. This can be used 1) in addition to a GPR project file specified with -P or 2) instead of such specification. In case 1), this can be used to generate a report from an arbitrary SAM file, whereas the one from the latest analysis (or corresponding to the specified timeline) is used otherwise. In case 2), the report format must be explicitly provided (e.g. 'text') and only the following formats are supported: [text, csv, exit-code, security, gnathub]. This can be useful in workflows where the project dependencies are not available in the environment. Note that options (such as filters) specified in the project file will not apply in such case and should be passed to the command-line if required.
12.10.4. OPTIONS
- --compare-with=VAL
Specify a SAM file for a one-off comparison with the selected analysis run (the last run of the specified timeline, or the current run if no timeline was specified).
- -o FILE, --out=FILE
File in which the report should be written. '-' means standard output.
- --show=VAL
Selectively hide or show messages according to the tool that emitted them, what they're about, the file or project they come from or whether they're new or not. See the SHOW OPTION FORMATTING section of the "gnatsas report --help" documentation page for detailed format of this option. Specifying this switch multiple times performs a union of the results of each filter.
- --timeline=VAL
Timeline to use for the report.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.10.5. COMMON OPTIONS
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE (required)
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.10.6. EXIT STATUS
html exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.10.7. SEE ALSO
gnatsas(1)
12.11. gnatsas-report-sarif
12.11.1. NAME
gnatsas-report-sarif - Generate report in SARIF format.
12.11.2. SYNOPSIS
gnatsas report sarif [OPTION]… [FILE.sam]
12.11.3. ARGUMENTS
- FILE.sam
[Optional] Specify a SAM file from which to generate a report. This can be used 1) in addition to a GPR project file specified with -P or 2) instead of such specification. In case 1), this can be used to generate a report from an arbitrary SAM file, whereas the one from the latest analysis (or corresponding to the specified timeline) is used otherwise. In case 2), the report format must be explicitly provided (e.g. 'text') and only the following formats are supported: [text, csv, exit-code, security, gnathub]. This can be useful in workflows where the project dependencies are not available in the environment. Note that options (such as filters) specified in the project file will not apply in such case and should be passed to the command-line if required.
12.11.4. OPTIONS
- --compare-with=VAL
Specify a SAM file for a one-off comparison with the selected analysis run (the last run of the specified timeline, or the current run if no timeline was specified).
- -o FILE, --out=FILE
File in which the report should be written. '-' means standard output.
- --print-all-rules
Include all rules (including CWEs) checked by GNATSAS in the output SARIF log. If not specified, only the rules (and CWEs) corresponding to actual results are included. Use this option when stability of the SARIF log is a strong requirement, e.g. for GitHub code scanning.
- --root=DIR
Make the URIs in the SARIF files relative to DIR instead of the project directory. The purpose of this switch is to provide portability by letting users control the relative path (uri) to source files in the generated SARIF results.
- --show=VAL
Selectively hide or show messages according to the tool that emitted them, what they're about, the file or project they come from or whether they're new or not. See the SHOW OPTION FORMATTING section of the "gnatsas report --help" documentation page for detailed format of this option. Specifying this switch multiple times performs a union of the results of each filter.
- --timeline=VAL
Timeline to use for the report.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.11.5. COMMON OPTIONS
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE (required)
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.11.6. EXIT STATUS
sarif exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.11.7. SEE ALSO
gnatsas(1)
12.12. gnatsas-report-security
12.12.1. NAME
gnatsas-report-security - Generate a security report.
12.12.2. SYNOPSIS
gnatsas report security [OPTION]… [FILE.sam]
12.12.3. ARGUMENTS
- FILE.sam
[Optional] Specify a SAM file from which to generate a report. This can be used 1) in addition to a GPR project file specified with -P or 2) instead of such specification. In case 1), this can be used to generate a report from an arbitrary SAM file, whereas the one from the latest analysis (or corresponding to the specified timeline) is used otherwise. In case 2), the report format must be explicitly provided (e.g. 'text') and only the following formats are supported: [text, csv, exit-code, security, gnathub]. This can be useful in workflows where the project dependencies are not available in the environment. Note that options (such as filters) specified in the project file will not apply in such case and should be passed to the command-line if required.
12.12.4. OPTIONS
- --compare-with=VAL
Specify a SAM file for a one-off comparison with the selected analysis run (the last run of the specified timeline, or the current run if no timeline was specified).
- -o FILE, --out=FILE
File in which the report should be written. '-' means standard output.
- --show=VAL
Selectively hide or show messages according to the tool that emitted them, what they're about, the file or project they come from or whether they're new or not. See the SHOW OPTION FORMATTING section of the "gnatsas report --help" documentation page for detailed format of this option. Specifying this switch multiple times performs a union of the results of each filter.
- --show-mitigated-cwes
Show full security report, including CWEs mitigated by Ada.
- --timeline=VAL
Timeline to use for the report.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.12.5. COMMON OPTIONS
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.12.6. EXIT STATUS
security exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.12.7. SEE ALSO
gnatsas(1)
12.13. gnatsas-report-text
12.13.1. NAME
gnatsas-report-text - Display results in text format.
12.13.2. SYNOPSIS
gnatsas report text [OPTION]… [FILE.sam]
12.13.3. ARGUMENTS
- FILE.sam
[Optional] Specify a SAM file from which to generate a report. This can be used 1) in addition to a GPR project file specified with -P or 2) instead of such specification. In case 1), this can be used to generate a report from an arbitrary SAM file, whereas the one from the latest analysis (or corresponding to the specified timeline) is used otherwise. In case 2), the report format must be explicitly provided (e.g. 'text') and only the following formats are supported: [text, csv, exit-code, security, gnathub]. This can be useful in workflows where the project dependencies are not available in the environment. Note that options (such as filters) specified in the project file will not apply in such case and should be passed to the command-line if required.
12.13.4. OPTIONS
- --compare-with=VAL
Specify a SAM file for a one-off comparison with the selected analysis run (the last run of the specified timeline, or the current run if no timeline was specified).
- -o FILE, --out=FILE
File in which the report should be written. '-' means standard output.
- --show=VAL
Selectively hide or show messages according to the tool that emitted them, what they're about, the file or project they come from or whether they're new or not. See the SHOW OPTION FORMATTING section of the "gnatsas report --help" documentation page for detailed format of this option. Specifying this switch multiple times performs a union of the results of each filter.
- --show-backtraces
Show backtraces.
- --show-header
Add header to output
- --show-reviews
Print review information, if any, alongside the messages. This prints the current review status, date of review, name of reviewer and associated comment.
- --timeline=VAL
Timeline to use for the report.
- (Deprecated) --file=VAL
[use --timeline instead] Analyze a single file, ignoring other files from the project.
- (Deprecated) --files-from=VAL
[use --timeline instead] Specify the path of a file containing a list of files to analyze.
- (Deprecated) --mode=VAL
[use --timeline instead] Analysis mode. Supported modes are 'fast' (default if not specified), 'deep'.
- (Deprecated) --no-subprojects
[use --timeline instead] Analyze all files in the root project only, ignoring all subprojects and also ignoring main units defined in the root project.
- (Deprecated) -U [FILE] (default=)
[use --timeline instead] When FILE is specified, analyze files contained in the closure of the FILE unit. If set and no FILE is specified, analyze all files in the full project tree, except externally built ones.
12.13.5. COMMON OPTIONS
- --force-lock
Force gnatsas lock file.
- --help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
- --list-timelines
List available timelines for project with detailed information and exit with return code 0 without performing other actions.
- --log-to=VAL
Specify log file.
- -P GPRFILE
Perform analysis, reporting and baseline management on GPRFILE.
- -q, --quiet
Suppress info output.
- --save-temps, --keep-temp-files
Do not remove temporary files. Only useful for debugging.
- --subdirs=VAL
Relative path from the object directory to the gnatsas directory where results and intermediate files will be output. The path to the gnatsas directory will be '[<object_dir>/]<subdirs>/gnatsas'. This overrides the 'Subdirs' attribute of the 'Analyzer' package. Note that if the 'Output_Dir' attribute is set in the 'Analyzer' package of the project, analysis results will be stored in that directory instead, whereas the location of intermediate files will remain as specified by this switch.
- --unset-log-flag=VAL
Deactivate a flagged output.
- -v, --verbose
Give verbose output.
- --version
Show version information.
- -X VAR=VALUE
Set scenario variable VAR to VALUE during analysis of project.
12.13.6. EXIT STATUS
text exits with the following status:
- 0
on success.
- 123
on indiscriminate errors reported on standard error.
- 124
on command line parsing errors.
- 125
on unexpected internal errors (bugs).
12.13.7. SEE ALSO
gnatsas(1)