{"id":20641822,"url":"https://github.com/rasjani/processcdb","last_synced_at":"2025-07-27T05:37:18.548Z","repository":{"id":55411361,"uuid":"119972884","full_name":"rasjani/processcdb","owner":"rasjani","description":"Tool for providing static analysis of items in Clang's compilation database.","archived":false,"fork":false,"pushed_at":"2021-05-11T08:54:34.000Z","size":78,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T03:32:07.969Z","etag":null,"topics":["clang-tidy","cli","cppcheck","hacktoberfest","hacktoberfest2020","jenkins","python","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rasjani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-02T11:19:04.000Z","updated_at":"2024-06-08T23:56:24.000Z","dependencies_parsed_at":"2022-08-14T23:50:13.788Z","dependency_job_id":null,"html_url":"https://github.com/rasjani/processcdb","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasjani%2Fprocesscdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasjani%2Fprocesscdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasjani%2Fprocesscdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasjani%2Fprocesscdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rasjani","download_url":"https://codeload.github.com/rasjani/processcdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631686,"owners_count":21136562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clang-tidy","cli","cppcheck","hacktoberfest","hacktoberfest2020","jenkins","python","static-analysis"],"created_at":"2024-11-16T16:06:45.796Z","updated_at":"2025-04-16T01:37:09.568Z","avatar_url":"https://github.com/rasjani.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"processcdb\n==========\n\nSimple front-end tool that can run various static analysis tools by\nreading the required information from compile_commands.json.\n\nProvides output formatting for integration to other tools, parallerization\nwhen needed, ability to override/reconfigure compiler flags and such on per\n\"tool\" plugin requirements.\n\nCurrent development is done mainly on Windows but should work on any platform\nwhere you have python, working development environment for your own project\nand analyzer. Currently supported ones:\n\n * clang-tidy\n * cppcheck\n * lizard\n\nInstallation\n============\n\nProject is available in pypi as source distribution:\n\n    pip install processcdb\n\nSince processcdb will also install few dependencies, using [pipx](https://github.com/pipxproject/pipx) for installation\nis adviced.\n\nOnce package is installed. Generate a configuration file with:\n\n    processcdb --dump-config\n\nThis will generate barebones configuration file to default location (can be overwritten later with\n--config argument). Edit this file to point \"binary\" options for those analyzer to point to their executable.\nOn windows, do not omit file extension.\n\nUsage\n=====\n\nBasic help:\n\n    processcdb --help\n\nAfter a process of generating a compile_commands.json, you can run processcdb with selected tool like this:\n\n    processcdb --tool clang-tidy\n\nThis will try to locate the json file from current working directory and runs the tool, in this case\nclang-tidy, against all files that are compiled and not blacklisted in processcdb comfig file or in\ntools own configuration file and generates the output to standard output. If you need to run the tool when you\ndon't have access to change the current working directory, you can pass `--cdb` and absolute location:\n\n    processcdb --tool clang-tidy --cdb D:\\src\\myproject\\build\\compile_commands.json\n\nOne can direct the tools output to a file with `--output` argument. Worth noting that that certain tools\n(`-t`) can provide further arguments for post processing or tool specific purposes:\n\n    processcdb --tool clang-tidy --cdb ~/src/myproject/build/compile_commands.json --output scan.log --xml\n\nIf processcdb is invoked without passing `--config` argument, a default configuration file is used. Location\ndepends on operating system. If you need to analyze multiple projects with different sort of settings or\nyou want to analyze with different versions of a particular scanner, use multiple configuration files.\n\nFor example, if you have a codebase thst you wish to scan with clang 11.0.0 but your project is really compiled\nwith Microsoft's msvc and you have another project that does compile with clang: make separate config file for\nmsvc and clang and invoke processcdb:\n\n    processcdb --tool clang-tidy --config location/to/config/msvc17_clang_interop.ini\n\nConfiguration\n=============\n\nIf processcdb is invoked without passing `--config` argument, a default configuration file is used. To generate\na config file, pass `--dump-config` to the processcdb. To save the default config file to a file. either\ncapture the standard output or provide `--config` parameter.\n\n## Configuration file\n\nEach tool has a separate section and each section can be configured either in the tool specific section or\nin default. Minimal. single tool configuratio would look something like this:\n\n    [clang-tidy]\n    binary=C:\\llvm-11.0.0\\bin\\clang-tidy.exe\n\nHere we have section for clang-tidy tool, where we are setting a variable `binary` to a value of\n`c:\\llvm-11.0.0\\bin\\clang-tidy.exe`.\n\nPython `configparser` module is used for loading/parsing of the file.\n\nFollowing variables are shared between the tools:\n\n  * `binary` - absolute path to a scanner.\n  * `file_blacklist` - list of file specs that should be omitted from the scan\n  * `arg_blacklist` - list of command line arguments passed to compiler that should not be passed to a tool.\n  * `arg_additions` - a list of of key/value pairs. If key is found in json, a value is placed into tool's\n      arguments.\n  * `jobs` - default number processes processcdb or the tool can use to process. 0 for auto detect.\n  * `default_includes` - list of paths that should be automatically passed to the tool as include paths which\n      might not be be specified in the compile_commands.json\n  * `default_args` - list of arguments that should be passed to the tool that are not provided by the\n      compile_commands.json\n  * `includes_as_system`: list of file specs that that should converted from normal -I include to -isystem\n      include.\n\nEach config option that is a list and allows multiple values, use semicolon as item separator.\n\nwith `arg_blacklist`, one can strip away unnecessary command line arguments and `arg_addition` can be used to\ninject new arguments. For example, if is compiling a project in msvc and exceptions are enabled, following\nconfiguration would allow clang-tidy tool to still work correctly:\n\n```config\n[clang-tidy]\nbinary=C:\\llvm-11.0.0\\bin\\clang-tidy.exe\narg_blacklist=EHsc\narg_additions=EHsc=-Xclang,-fcxx-exceptions\n```\n\nAs first, processcdb would notice that compile_commands.json might have `/EHsc` argument, it would add 2 new arguments\n`-Xclang` and '-fcxx-exceptions' and then arg_blacklist would then remove the original `/EHsc`\n\ncppcheck tool also has option `supression_file` which, if needed, should be absolute location of cppchecks own\nsuppression file.\n\nCredits\n=======\n\nclang-tidy toool's ability to convert the logfile to xml for direct jenkins support is part of [CodeChecker](https://github.com/Ericsson/codechecker) project\nand its licensed under Apache 2.0\n\n\nLinks\n=====\n\nHome: https://github.com/rasjani/processcdb\nIssues: https://github.com/rasjani/processcdb/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasjani%2Fprocesscdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frasjani%2Fprocesscdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasjani%2Fprocesscdb/lists"}