{"id":14986832,"url":"https://github.com/angular/clang-format","last_synced_at":"2025-04-05T01:09:00.236Z","repository":{"id":28880653,"uuid":"32405165","full_name":"angular/clang-format","owner":"angular","description":"Node repackaging of the clang-format native binary","archived":false,"fork":false,"pushed_at":"2024-04-04T19:11:07.000Z","size":97160,"stargazers_count":100,"open_issues_count":10,"forks_count":31,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-29T00:11:16.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angular.png","metadata":{"files":{"readme":"README.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-17T16:21:18.000Z","updated_at":"2025-01-25T15:38:13.000Z","dependencies_parsed_at":"2024-06-18T12:36:16.429Z","dependency_job_id":"85e5ad07-bb4b-47a4-af9f-58f80fea9202","html_url":"https://github.com/angular/clang-format","commit_stats":{"total_commits":190,"total_committers":17,"mean_commits":"11.176470588235293","dds":"0.17894736842105263","last_synced_commit":"41f1d0a6dae1f04ad2476daa15d989629aea373c"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular%2Fclang-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular%2Fclang-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular%2Fclang-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular%2Fclang-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angular","download_url":"https://codeload.github.com/angular/clang-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271532,"owners_count":20911587,"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":[],"created_at":"2024-09-24T14:13:37.544Z","updated_at":"2025-04-05T01:09:00.219Z","avatar_url":"https://github.com/angular.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/angular/clang-format/actions/workflows/node.js.yml/badge.svg)](https://github.com/angular/clang-format/actions/workflows/node.js.yml)\n\n# clang-format\nnode.js module which wraps the native clang-format executable.\n\n## From the command-line:\n\n    $ npm install -g clang-format\n    $ clang-format -help\n\nIf your platform isn't yet supported, you can create the native binary from\nthe latest upstream clang sources, make sure it is stripped and optimized\n(should be about 1.4MB as of mid-2015) and send a pull request to add it.\n\n## Checking formatting\n\nEnsuring that changes to your code are properly formatted is an important part\nof your development workflow. Note that the `check-clang-format` and\n`git-clang-format` commands require Python to be globally available.\n\nWe recommend using a git pre-commit hook. You can configure this as follows:\n\n1. add a `precommit` script to your package.json file:\n\n    ```js\n    \"scripts\": {\n        \"precommit\": \"check-clang-format\"\n    }\n    ```\n\n    By default, the user gets an error instructing them to run\n    `./node_modules/.bin/git-clang-format`. You may find it more ergonomic to set\n    up a package.json script, eg.\n    `\"scripts\": { \"format\": \"git-clang-format\" }`\n\n    In this case, add a second argument to the \"precommit\" script, giving the\n    error you'd like to print for users, eg.\n\n    `\"precommit\": \"check-clang-format \\\"yarn format\\\"\"`\n\n2. Add a devDependency on the `husky` package, which will add a\n  `.git/hooks/pre-commit` script, which in turn triggers the `precommit`\n  package.json script to run whenever someone adds a commit in this repository:\n\n    ```sh\n    $ yarn add -D husky\n    ```\n\n    or\n\n    ```sh\n    npm install --save-dev husky\n    ```\n\n\u003e Why do this in a pre-commit hook? For one thing, it's faster to run\n  `clang-format` only on the changed files, especially as the repository grows.\n  Also, this lets you upgrade `clang-format` or change your settings without\n  needing to re-format the entire repository, while still enforcing that later\n  changes follow the new style.\n\n## Globbing files\n\n    $ clang-format --glob=folder/**/*.js\n\nThis will run `clang-format` once per file result, and show the total\nformatted files at the end.\nSee [node-glob](https://github.com/isaacs/node-glob) for globbing semantics.\n\n## Compiling clang-format\n\nFor Linux, compile a statically linked MinSizeRel build:\n\n    git clone --depth=1 https://github.com/llvm/llvm-project.git\n    cd llvm-project\n    mkdir build\n    cd build\n    cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_BUILD_STATIC=true -DLLVM_ENABLE_PROJECTS=clang ../llvm\n    ninja clang-format\n    strip bin/clang-format\n\nFor Mac OS X, static linking is not required.\n\n## Windows\n\nWindows snapshot builds to include in the release can be found at the\n[LLVM website](http://llvm.org/builds/).\n\nConfigure with:\n\n    cmake -G \"Visual Studio 12\" -DCMAKE_BUILD_TYPE=MinSizeRel ..\n\nIn the generated Visual Studio project, search for the `clang-format` binary in\nthe Solution Explorer window, right click and choose Build.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular%2Fclang-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangular%2Fclang-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular%2Fclang-format/lists"}