Title: cppcheck options: add --output-file-type option by RobertWak · Pull Request #3350 · cppcheck-opensource/cppcheck · GitHub
Open Graph Title: cppcheck options: add --output-file-type option by RobertWak · Pull Request #3350 · cppcheck-opensource/cppcheck
X Title: cppcheck options: add --output-file-type option by RobertWak · Pull Request #3350 · cppcheck-opensource/cppcheck
Description: When used with tools such as cmake, cppcheck doesn't provide an convenient way to output into files. I've added two values for new --output-file-type option: uniq: this will create a output file name based on the --output-file and the current file(s) that are analyzed append: this will open the --output-file file in append mode and add the content to it example: Not using the new option: $ cppcheck --enable=all --xml --xml-version=2 --output-file=output_files/cppcheck.xml cli/cmdlineparser.cpp $ ls -la output_files/ total 12 drwxrwxr-x 2 user user 4096 Jul 22 14:47 . drwxrwxr-x 26 user user 4096 Jul 22 14:36 .. -rw-rw-r-- 1 user user 1283 Jul 22 14:47 cppcheck.xml Using the option with value "uniq" for one file: $ cppcheck --enable=all --xml --xml-version=2 --output-file=output_files/cppcheck.xml --output-file-type=uniq cli/cmdlineparser.cpp $ ls -la output_files/ total 12 drwxrwxr-x 2 user user 4096 Jul 22 14:48 . drwxrwxr-x 26 user user 4096 Jul 22 14:36 .. -rw-rw-r-- 1 user user 1283 Jul 22 14:48 cppcheck_cmdlineparser_cpp.xml Using the option with value "uniq" for two files: $ cppcheck --enable=all --xml --xml-version=2 --output-file=output_files/cppcheck.xml --output-file-type=uniq cli/cmdlineparser.cpp cli/cppcheckexecutor.cpp $ ls -la output_files/ total 16 drwxrwxr-x 2 user user 4096 Jul 22 14:49 . drwxrwxr-x 26 user user 4096 Jul 22 14:36 .. -rw-rw-r-- 1 user user 4308 Jul 22 14:49 cppcheck_cmdlineparser_cpp_cppcheckexecutor_cpp.xml Using the option with value "append" for one file on a empty/non-existing file: $ cppcheck --enable=all --xml --xml-version=2 --output-file=output_files/cppcheck.xml --output-file-type=append cli/cmdlineparser.cpp $ ls -la output_files/ total 12 drwxrwxr-x 2 user user 4096 Jul 22 14:51 . drwxrwxr-x 26 user user 4096 Jul 22 14:36 .. -rw-rw-r-- 1 user user 1283 Jul 22 14:51 cppcheck.xml Using the option with value "append" for two files on a empty/non-existing file: $ cppcheck --enable=all --xml --xml-version=2 --output-file=output_files/cppcheck.xml --output-file-type=append cli/cmdlineparser.cpp cli/cppcheckexecutor.cpp $ ls -la output_files/ total 16 drwxrwxr-x 2 user user 4096 Jul 22 14:53 . drwxrwxr-x 26 user user 4096 Jul 22 14:36 .. -rw-rw-r-- 1 user user 4308 Jul 22 14:53 cppcheck.xml Using the option with value twise "append" for one file on a empty/non-existing file: $ cppcheck --enable=all --xml --xml-version=2 --output-file=output_files/cppcheck.xml --output-file-type=append cli/cmdlineparser.cpp $ cppcheck --enable=all --xml --xml-version=2 --output-file=output_files/cppcheck.xml --output-file-type=append cli/cppcheckexecutor.cpp $ ls -la output_files/ total 16 drwxrwxr-x 2 user user 4096 Jul 22 14:54 . drwxrwxr-x 26 user user 4096 Jul 22 14:36 .. -rw-rw-r-- 1 user user 5613 Jul 22 14:55 cppcheck.xml /!\ the file is a pure concatenation of the files created without the "append" value which means that it's no more a valid XML file as it will have twice the "" entry $ cat output_files/cppcheck.xml [...] [...]
Open Graph Description: When used with tools such as cmake, cppcheck doesn't provide an convenient way to output into files. I've added two values for new --output-file-type option: uniq: this will c...
X Description: When used with tools such as cmake, cppcheck doesn't provide an convenient way to output into files. I've added two values for new --output-file-type option: uniq: thi...
Opengraph URL: https://github.com/cppcheck-opensource/cppcheck/pull/3350
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7688c4e5-e7cb-0a77-8db5-cab6af5b5480 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C2C0:39F4B2:B77BB6:BAF397:6A512761 |
| html-safe-nonce | 0c2cdef8e45afac35a27398f5cfc88e2758d16a870aa8a4ce485b55bb94864e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkMwOjM5RjRCMjpCNzdCQjY6QkFGMzk3OjZBNTEyNzYxIiwidmlzaXRvcl9pZCI6IjEwNjE3NzEyNDUxMjM2MTA0NjUiLCJyZWdpb25fZWRnZSI6InNlYSIsInJlZ2lvbl9yZW5kZXIiOiJzZWEifQ== |
| visitor-hmac | 92922657169f56938e2f7b076a56aa004f525a43531ce289e8d9275548c5d8a7 |
| hovercard-subject-tag | pull_request:695233520 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/cppcheck-opensource/cppcheck/pull/3350/files |
| twitter:image | https://avatars.githubusercontent.com/u/77058042?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/77058042?s=400&v=4 |
| og:image:alt | When used with tools such as cmake, cppcheck doesn't provide an convenient way to output into files. I've added two values for new --output-file-type option: uniq: this will c... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 689b683944b0d7f015d0e776452c970832fa81b82dc15284469b556ecced715b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/cppcheck-opensource/cppcheck git https://github.com/cppcheck-opensource/cppcheck.git |
| octolytics-dimension-user_id | 278097703 |
| octolytics-dimension-user_login | cppcheck-opensource |
| octolytics-dimension-repository_id | 143131 |
| octolytics-dimension-repository_nwo | cppcheck-opensource/cppcheck |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 143131 |
| octolytics-dimension-repository_network_root_nwo | cppcheck-opensource/cppcheck |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 942b51ed3bd5feee3d5e2719f890a5fe286edbbb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width