{"id":13441775,"url":"https://github.com/uncrustify/uncrustify","last_synced_at":"2025-10-21T03:56:22.478Z","repository":{"id":695932,"uuid":"340637","full_name":"uncrustify/uncrustify","owner":"uncrustify","description":"Code beautifier","archived":false,"fork":false,"pushed_at":"2025-10-08T16:22:26.000Z","size":29835,"stargazers_count":2965,"open_issues_count":353,"forks_count":586,"subscribers_count":73,"default_branch":"master","last_synced_at":"2025-10-21T03:56:09.753Z","etag":null,"topics":["beautifier","beautify","code-style","format","formatter"],"latest_commit_sha":null,"homepage":"http://uncrustify.sourceforge.net/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uncrustify.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2009-10-17T18:39:53.000Z","updated_at":"2025-10-20T02:24:43.000Z","dependencies_parsed_at":"2024-05-21T02:36:42.390Z","dependency_job_id":"4f224384-531a-444c-921e-20c9114318c0","html_url":"https://github.com/uncrustify/uncrustify","commit_stats":{"total_commits":4555,"total_committers":211,"mean_commits":"21.587677725118482","dds":0.8032930845225028,"last_synced_commit":"47fea596fbc6acb061ba5dffbb7646120621ed92"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/uncrustify/uncrustify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncrustify%2Funcrustify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncrustify%2Funcrustify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncrustify%2Funcrustify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncrustify%2Funcrustify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uncrustify","download_url":"https://codeload.github.com/uncrustify/uncrustify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uncrustify%2Funcrustify/sbom","scorecard":{"id":909081,"data":{"date":"2025-08-11","repo":{"name":"github.com/uncrustify/uncrustify","commit":"323889d38cade4ce4d667db50fb68a69f983ab5a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"18 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/uncrustify_test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: COPYING:0","Info: FSF or OSI recognized license: GNU General Public License v2.0: COPYING:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact uncrustify-0.81.0 not signed: https://api.github.com/repos/uncrustify/uncrustify/releases/219280576","Warn: release artifact uncrustify-0.80.1 not signed: https://api.github.com/repos/uncrustify/uncrustify/releases/185804298","Warn: release artifact uncrustify-0.80.0 not signed: https://api.github.com/repos/uncrustify/uncrustify/releases/185581635","Warn: release artifact uncrustify-0.79.0 not signed: https://api.github.com/repos/uncrustify/uncrustify/releases/155826706","Warn: release artifact uncrustify-0.78.1 not signed: https://api.github.com/repos/uncrustify/uncrustify/releases/130326274","Warn: release artifact uncrustify-0.81.0 does not have provenance: https://api.github.com/repos/uncrustify/uncrustify/releases/219280576","Warn: release artifact uncrustify-0.80.1 does not have provenance: https://api.github.com/repos/uncrustify/uncrustify/releases/185804298","Warn: release artifact uncrustify-0.80.0 does not have provenance: https://api.github.com/repos/uncrustify/uncrustify/releases/185581635","Warn: release artifact uncrustify-0.79.0 does not have provenance: https://api.github.com/repos/uncrustify/uncrustify/releases/155826706","Warn: release artifact uncrustify-0.78.1 does not have provenance: https://api.github.com/repos/uncrustify/uncrustify/releases/130326274"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/uncrustify_test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/uncrustify/uncrustify/uncrustify_test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/uncrustify_test.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/uncrustify/uncrustify/uncrustify_test.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T18:27:38.925Z","repository_id":695932,"created_at":"2025-08-24T18:27:38.925Z","updated_at":"2025-08-24T18:27:38.925Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280200865,"owners_count":26289477,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["beautifier","beautify","code-style","format","formatter"],"created_at":"2024-07-31T03:01:37.916Z","updated_at":"2025-10-21T03:56:22.471Z","avatar_url":"https://github.com/uncrustify.png","language":"C++","readme":"[![AppVeyor](https://img.shields.io/appveyor/ci/uncrustify/uncrustify/master.svg?style=flat-square\u0026label=Windows)](https://ci.appveyor.com/project/uncrustify/uncrustify)\n[![Coverage Status](https://coveralls.io/repos/github/uncrustify/uncrustify/badge.svg?branch=master)](https://coveralls.io/github/uncrustify/uncrustify?branch=master)\n\u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/badge/C++-11-blue.svg?style=flat-square\"\u003e\u003c/a\u003e\n[![Conan Center](https://shields.io/conan/v/uncrustify)](https://conan.io/center/uncrustify)\n\n---------------------------\n\n# Uncrustify\nA source code beautifier for C, C++, C#, Objective-C, D, Java, Pawn and Vala.\n\n## Features\n* Highly configurable - 857 configurable options as of version 0.81.0\n- \u003cdetails\u003e\u003csummary\u003eadd/remove spaces\u003c/summary\u003e\n\n  - `sp_before_sparen`: _Add or remove space before '(' of 'if', 'for', 'switch', 'while', etc._\n  - `sp_compare`: _Add or remove space around compare operator '\u003c', '\u003e', '==', etc_\n\u003c/details\u003e\n\n- \u003cdetails\u003e\u003csummary\u003eadd/remove newlines\u003c/summary\u003e\n\n  - `nl_if_brace`: _Add or remove newline between 'if' and '{'_\n  - `nl_brace_while`: _Add or remove newline between '}' and 'while' of 'do' statement_\n\u003c/details\u003e\n\n- \u003cdetails\u003e\u003csummary\u003eadd/remove blanklines\u003c/summary\u003e\n\n  - `eat_blanks_before_close_brace`: _Whether to remove blank lines before '}'_\n  - `nl_max`: _The maximum consecutive newlines (3 = 2 blank lines)_\n\u003c/details\u003e\n\n- \u003cdetails\u003e\u003csummary\u003eindent code\u003c/summary\u003e\n\n  - `indent_switch_case`: _indent_switch_case: Spaces to indent 'case' from 'switch'_\n  - `indent_class_colon`: _Whether to indent the stuff after a leading base class colon_\n\u003c/details\u003e\n\n- \u003cdetails\u003e\u003csummary\u003ealign code\u003c/summary\u003e\n\n  - `align_func_params`: _Align variable definitions in prototypes and functions_\n  - `align_struct_init_span`: _The span for aligning struct initializer values (0=don't align)_\n\u003c/details\u003e\n\n- \u003cdetails\u003e\u003csummary\u003emodify code\u003c/summary\u003e\n\n  - `mod_full_brace_for`: _Add or remove braces on single-line 'for' statement_\n  - `mod_paren_on_return`: _Add or remove unnecessary paren on 'return' statement_\n\u003c/details\u003e\n\nHere is an example [configuration file](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/ben.cfg.txt),\nand here is a [before](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/examples/c-1.in.c)\nand [after](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/examples/c-1.out.c)\nC source example.\nThat should give you a pretty good idea of what Uncrustify can do.\n\n\n\n\n\n---------------------------------------------------------------------------\n\n## Binaries\nPre compiled binaries for Windows can be downloaded from the [Releases](https://github.com/uncrustify/uncrustify/releases) page or from the [Sourceforge](https://sourceforge.net/projects/uncrustify/files/) website.\n\n## Build\n[Python](https://www.python.org/) is an \"interpreted high-level programming language for general-purpose programming\", for this project it is needed to extend the capabilities of CMake.\n\n[CMake](https://cmake.org/) is a tool that generates build systems\n(Makefiles, Visual Studio project files, Xcode project files and others).\n\nTo generate a build system for Uncrustify using CMake on UNIX-like systems, create a\nbuild folder and run CMake from it, making sure to specify Release mode:\n\n```bash\nmkdir build\ncd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\n```\nOther systems may require other flags (e.g. `cmake -G Xcode ..` for Xcode).\n\nThen use the build tools of your build system (in many cases this will\nsimply be `make`, but on Windows it could be MSBuild or Visual Studio).\nOr use CMake to invoke it:\n\n```bash\ncmake --build . --config Release\n```\n\nIf testing is enabled, CMake generates a `test` target, which you can\n_build_ using your build system tools (usually `make test`). This can also\nbe invoked using CTest:\n\n```bash\nctest -V -C Debug\n```\n\nThere is also an `install` target, which can be used to install the\nUncrustify executable (typically `make install`).\n\n### A note on CMake configurations\nSome build systems are single-configuration, which means you specify the\nbuild type when running CMake (by setting the `CMAKE_BUILD_TYPE`\nvariable), and the generated files then build that configuration.\n\nAn example of a single-configuration build system are Makefiles. You can\nbuild the Release or Debug configurations of Uncrustify (from the build folder) with:\n\n```bash\ncmake -DCMAKE_BUILD_TYPE=Release ..\nmake\n```\nor\n```bash\ncmake -DCMAKE_BUILD_TYPE=Debug ..\nmake\n```\n\nOther build systems are multi-configuration, which means you specify the\nbuild type when building.\n\nAn example of a multi-configuration build system are Visual Studios project\nfiles. When you open the project in Visual Studio, you can select which\nconfiguration to build. You can also do this while building from the\ncommand line with `cmake --build . --config Debug`.\n\n\n## Bugs\nPost any bugs to the issue tracker found on the projects GitHub page:\n  https://github.com/uncrustify/uncrustify/issues\n\nPlease include the following with your issue:\n - a description of what is not working right\n - input code sufficient to demonstrate the issue\n - expected output code\n - configuration options used to generate the output\n\nMore about this is in the [ISSUE_TEMPLATE](https://github.com/uncrustify/uncrustify/blob/master/.github/ISSUE_TEMPLATE)\n\n\n### Known problems\n[Look at the Wiki](https://github.com/uncrustify/uncrustify/wiki/Known-Problems)\n\n\n## Which repositories have uncrustify?\n[Look here](https://repology.org/metapackage/uncrustify/versions)\n\n\n## Contribute\nIf you want to add a feature, fix a bug, or implement missing\nfunctionality, feel free to do so! Patches are welcome!\nHere are some areas that need attention:\n\n- __Patches for Objective-C support__. We really need someone who knows\n  this language as it has more than plenty open issues. A good starting\n  point would be to integrate changes made in the\n  [Unity fork](https://github.com/Unity-Technologies/uncrustify/tree/fixes/c-oc-java)\n- Test Java support and provide feedback (or patches!)\n- Test Embedded SQL to see what works\n- A logo of some sort\n- Anything else that you want to do to make it better?\n\n### A note about pull requests\nFirstly take a look at the [CONTRIBUTING.md](https://github.com/uncrustify/uncrustify/blob/master/CONTRIBUTING.md)\n\nCurrently we have two continuous integration systems that test your PRs,\nTravisCI and Appveyor.\nTested are the test cases, the formatting of the code base and\nthe output of the command line options.\n\nTest cases can be found in the `tests/` directory. Every file ending with\n`.test` is a test set. Inside each line with these components is a\nsingle test: `testNr[!] testConfigFileName testInputFileName [lang]`\n\nThe configuration file `testConfigFileName` has to be located inside `tests/config`,\nthe input file `testInputFileName` inside `tests/input/\u003ctestSetName\u003e/`,\nand expected results file inside the `tests/expected/\u003ctestSetName\u003e/`\ndirectory.\nExpected results have the following naming convention: `testNr-testInputFileName`.\n\nOptionally a `!` can follow the `testNr` to enable a custom rerun\nconfiguration.\nRerun configurations need to be named like this:\n`testConfigFileName`(without extension)+`.rerun`+`.extension`\n\nAlso, optionally a language for the input can be provided with `lang`.\n\nThe codebase has to be formatted by the options set up in\n`forUncrustifySources.cfg`. Failing to format the sources correctly will\ncause TravisCI build failures.\n\nThe Command line interface (CLI) output is tested by the\n`test_cli_options.py` script. It is located inside of `tests/cli/` and operates\non the subdirectories of that folder.\n\nIf a PR is altering the CLI output, files inside those directories might\nneed to be manually updated. This often happens when options are\nadded, removed, or altered. Keep in mind that the version string line\n(example: `# Uncrustify-0.69.0_f`) of outputs from commands like\n`--show-config` should be replaced with a blank line.\n\n### Debugging\n\nThe first method is to use uncrustify itself to get debug information.\nUsing:\n```bash\nuncrustify -c myExample.cfg -f myExample.cpp -p myExample.p -L A 2\u003emyExample.A\n```\nyou get two files for the first information.\nThe p-file gives you details of the parsing process and indentation.\n```.txt\n# Line                Tag              Parent          Columns Br/Lvl/pp     Flag   Nl  Text\n#   1\u003e              CLASS[               NONE][  1/  1/  6/  0][0/0/0][  10070000][0-0] class\n#   1\u003e               TYPE[              CLASS][  7/  7/ 14/  1][0/0/0][  10000000][0-0]       Capteur\n#   1\u003e         BRACE_OPEN[              CLASS][ 15/ 15/ 16/  1][0/0/0][ 100000400][0-0]               {\n```\n\nThe A-file gives you many details about the run itself, where the process is running through,\nwhich values have the most important variables.\n```.txt\ntokenize(2351): orig line is 1, orig col is 1, Text() 'class', type is CLASS, orig col_end is 6\ntokenize(2351): orig line is 1, orig col is 7, Text() 'Capteur', type is WORD, orig col_end is 14\ntokenize(2351): orig line is 1, orig col is 15, Text() '{', type is BRACE_OPEN, orig col_end is 16\n```\n\nYou can also dump the parsing information of each formatting step using the 'dump steps' option.\n```bash\nuncrustify -c myExample.cfg -f myExample.cpp -ds dump\n```\nThis will create a series of 'dump_nnn.log' files, each containing the parsing information at\nspecific points of the formatting process ('dump_000.log' will list the formatting options in use).\n\nYou can combine this option with -p and -L to get a lot of detailed debugging information.\n```bash\nuncrustify -c myExample.cfg -f myExample.cpp -p myExample.p -L A 2\u003emyExample.A -ds dump\n```\n\nIt might be useful to add some code lines to see where something is happening.\nUse the package `unc_tools`.\nRemove the comment at line:\n```.cpp\n#define DEVELOP_ONLY\n```\nImport the package:\n```.cpp\n#include \"unc_tools.h\"\n```\nAdd at some places the line:\n```.cpp\nprot_the_line(__LINE__, 6, 0);\n```\nCompile again with DEBUG option.\n\n\n\n### How to add an option\n\nIf you need a new option, there are a few steps to follow.\nTake as example the option `sp_trailing_ret_t`\n\nFirst define the option:\n- Insert the code below to the file src/options.h\n_NOTE:\nThis file is processed by make_options.py, and must conform to a particular\nformat. Option groups are marked by '//begin ' (in upper case; this example\nis lower case to prevent being considered a region marker for code folding)\nfollowed by the group description. Options consist of two lines of\ndeclaration preceded by one or more lines of C++ comments. The comments form\nthe option description and are taken verbatim, aside from stripping the\nleading '// '. Only comments immediately preceding an option declaration,\nwith no blank lines, are taken as part of the description, so a blank line\nmay be used to separate notations from a description.\nAn option declaration is 'extern TYPE\\nNAME;', optionally followed by\n' // = VALUE' if the option has a default value that is different from the\ndefault-constructed value type of the option. The 'VALUE' must be valid C++\ncode, and is taken verbatim as an argument when creating the option's\ninstantiation. Note also that the line break, as shown, is required.\n_\n```.cpp\n// Add or remove space around trailing return operator '-\u003e'.\nextern Option\u003ciarf_e\u003e\nsp_trailing_ret_t;\n```\n- Insert the code below to the file src/space.cpp\n```.cpp\n   if (first-\u003eIs(CT_TRAILING_RET_T))\n   {\n      // Add or remove space around trailing return operator '-\u003e'.\n      log_rule(\"sp_trailing_ret_t\");\n      return(options::sp_trailing_ret_t());\n   }\n```\n\n\n### Portability\n\nWe are pretty sure that nothing OS-specific is used in the code base.\nThe software has been previously tested on the following operating systems:\n- Linux\n- QNX\n- OS X\n- FreeBSD, NetBSD, OpenBSD\n- Sun Solaris 9\n- Windows (binary available)\n\n\n---------------------------------------------------------------------------\n\n## Running the program\n\n__NOTE__ This application works reasonably well but it has bugs. Do __not__\napply it on your whole codebase without checking the results!\n\nHere are ways to run it:\n```bash\nuncrustify -c mystyle.cfg -f somefile.c -o somefile.c.unc\nuncrustify -c mystyle.cfg -f somefile.c \u003e somefile.c.unc\nuncrustify -c mystyle.cfg somefile.c\nuncrustify -c mystyle.cfg --no-backup somefile.c\nuncrustify -c mystyle.cfg *.c\nuncrustify -c mystyle.cfg --no-backup *.c\n```\nThe `-c` flag selects the configuration file.\nThe `-f` flag specifies the input file.\nThe `-o` flag specifies the output file.\nIf flag `-f` is used without flag `-o` the output will be send to `stdout`.\n\nAlternatively, multiple or single files that should be processed can be\nspecified at the command end without flags.\nIf the flag `--no-backup` is missing, every file is saved with the initial\nname and an additional suffix (can be changed with --suffix).\n\nFor more options descriptions call:\n```bash\nuncrustify -h\n```\n\n## Configuring the program\nUncrustify usually reads configuration files that are passed via the `-c`\nflag. If the flag is not provided, Uncrustify will try to find a\nconfiguration file via the `UNCRUSTIFY_CONFIG` environment variable or a\nfile with the name `.uncrustify.cfg` or `uncrustify.cfg` in your home folder.\n\nTo get a list of:\n- all available options use:\n  ```bash\n  uncrustify --show-config\n  ```\n\n- all available options in a usable configuration file format use:\n  ```bash\n  uncrustify --update-config\n  ```\n\n  or\n\n  ```bash\n  uncrustify --update-config-with-doc\n  ```\n\n  As the names suggest, both options can produce output that adds newly\n  introduced options to your old configuration file. For this your old\n  configuration file has to be passed via the `-c` flag:\n  ```bash\n  uncrustify --update-config-with-doc -c path/to/your.cfg\n  ```\n\nExample configuration files that can be used as a starting point can be\nfound in the `etc/` directory (such as [ben.cfg](./etc/ben.cfg)).\n\nModify to your liking. Use a quality side-by-side diff tool to determine\nif the program did what you wanted. Repeat until your style is refined.\n\nTo ease the process a bit, some 3rd party tools are available:\n- [Universal Indent GUI](http://universalindent.sourceforge.net/) - A\n  cross-platform graphical configuration file editor for many code\n  beautifiers, including Uncrustify. This is currently unmaintained.\n- [Universal Indent GUI TQt](https://mirror.git.trinitydesktop.org/gitea/TDE/universal-indent-gui-tqt) - A\n  maintained port of the above tool provided by the Trinity Desktop Environment (TDE) team.\n  See how to install binary packages for your distro\n  [here](https://wiki.trinitydesktop.org/Category:Documentation#Installing_from_a_Package_Manager).\n  \u003cbr/\u003e**Note** you don't need to install TDE to run Universal Indent GUI TQt,\n  it only needs a few libraries. Therefore it can easily be used in any\n  other desktop environment.\n- [uncrustify_config](https://github.com/CDanU/uncrustify_config) - A web\n  configuration tool based on Uncrustify's emscripten interface.\n- [UncrustifyX](https://github.com/ryanmaxwell/UncrustifyX) - Uncrustify\n  utility and documentation browser for Mac OS X\n\nUnder Windows:\nUncrustify is a command-line tool, if you run it by double-clicking the\nexecutable, it will open a command prompt run the executable\n(which prints the help message), and then immediately close the window\nas uncrustify exits.\n\nYou can open the command prompt (which is an interactive terminal\nwindow that allows you to run commands without it closing as soon as\nthey exit) and run uncrustify.exe there.\n\n## Using uncrustify with vim\nHave a look [here](https://github.com/cofyc/vim-uncrustify)\n  \n## Using uncrustify with IntelliJ\nHave a look at https://plugins.jetbrains.com/plugin/17528-uncrustify\n","funding_links":[],"categories":["C++","Coding Style Tools","Applications","Tools","By Environment","编码样式工具","Linters","应用"],"sub_categories":["Development","Code Formatting \u0026 Refactoring","C/C++","静态代码分析","开发"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funcrustify%2Funcrustify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funcrustify%2Funcrustify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funcrustify%2Funcrustify/lists"}