{"id":19767812,"url":"https://github.com/sarcasm/run-clang-format","last_synced_at":"2025-04-07T06:08:12.659Z","repository":{"id":138545460,"uuid":"105195750","full_name":"Sarcasm/run-clang-format","owner":"Sarcasm","description":"A wrapper script around clang-format, suitable for linting multiple files and to use for continuous integration","archived":false,"fork":false,"pushed_at":"2023-08-20T12:13:31.000Z","size":103,"stargazers_count":251,"open_issues_count":11,"forks_count":67,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T04:07:36.610Z","etag":null,"topics":["clang","clang-format","clang-tidy","continuous-integration"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sarcasm.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-09-28T20:25:12.000Z","updated_at":"2025-03-27T00:36:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"98008032-a901-4405-b615-9fc2f2bf3f7d","html_url":"https://github.com/Sarcasm/run-clang-format","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarcasm%2Frun-clang-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarcasm%2Frun-clang-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarcasm%2Frun-clang-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarcasm%2Frun-clang-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sarcasm","download_url":"https://codeload.github.com/Sarcasm/run-clang-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"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","clang-format","clang-tidy","continuous-integration"],"created_at":"2024-11-12T04:32:32.253Z","updated_at":"2025-04-07T06:08:12.628Z","avatar_url":"https://github.com/Sarcasm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=====================\n run-clang-format.py\n=====================\n----------------------------------------------\n Lint files and directories with clang-format\n----------------------------------------------\n\n.. contents::\n   :local:\n\nIntroduction\n============\n\nA wrapper script around clang-format, suitable for linting multiple files\nand to use for continuous integration.\n\nThis is an alternative API for the clang-format command line.\nIt runs over multiple files and directories in parallel.\nA diff output is produced and a sensible exit code is returned.\n\n.. image:: screenshot.png\n\n\nHow to use?\n===========\n\nCopy `run-clang-format.py \u003crun-clang-format.py\u003e`_ in your project,\nthen run it recursively on directories, or specific files::\n\n  ./run-clang-format.py -r src include foo.cpp\n\nIt's possible to exclude paths from the recursive search::\n\n  ./run-clang-format.py -r \\\n      --exclude src/third_party \\\n      --exclude '*_test.cpp' \\\n      src include foo.cpp\n\nThese exclude rules can be put in a ``.clang-format-ignore`` file,\nwhich also supports comments.\n\nAn example configuration is available in this repo::\n\n  $ cat .clang-format-ignore\n  # ignore third_party code from clang-format checks\n  src/third_party/*\n\n\nContinuous integration\n======================\n\nCheck `.travis.yml \u003c.travis.yml\u003e`_.\n\nFor an example of failure in logs, click the badge (build is broken on purpose):\n\n.. image:: https://travis-ci.org/Sarcasm/run-clang-format.svg?branch=master\n    :target: https://travis-ci.org/Sarcasm/run-clang-format\n\n\nFAQ\n===\n\nCan I check only changed files?\n-------------------------------\n\nNo, and this is what this repository was initially about.\nHowever, once working around a few shortcommings of ``git clang-format``,\nI opted to try an alternative strategy\nwhich expects the whole project to be correctly formatted.\n\nIt would make sense to support this feature as well,\nso that the coding style does not need to be enforced but merely suggested.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarcasm%2Frun-clang-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarcasm%2Frun-clang-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarcasm%2Frun-clang-format/lists"}