Skip to content

Command‐Line Flags

Joshua1023 edited this page Nov 24, 2023 · 2 revisions

This page will introduce some useful command-line flags of misra_analyzer.

src_dir

src_dir is the path to the directory to be checked in the working environment. It supports both absolute and relative formats. A relative path will be converted to an absolute one by adding the relative part to the path where misra_analyzer is executed.

Note: If misra_analyzer is running in the container, src_dir should be the path in the container instead of the exact path of the project to be checked.

ignore_dir

ignore_dir is used to skip the analysis of certain folders or files. It follows the doublestar pattern (https://github.com/bmatcuk/doublestar#patterns). If you want to ignore the file ignored.c, you can use the pattern **/ignored.c. If you want to use several patterns, you can use ignore_dir more than once.

For example, all header files and demo_ctu.c will be skipped during the analysis:

podman run --rm \
  -v $PWD:/src:O \
  -v $PWD/.naivesystems:/config:Z \
  -v $PWD/output:/output:Z \
  ghcr.io/naivesystems/analyze:master \
  /opt/naivesystems/misra_analyzer -show_results -ignore_dir=**/demo_ctu.c -ignore_dir=**/*.h

TODO: more command-line flags