{"id":20400112,"url":"https://github.com/codebrainz/code-format","last_synced_at":"2025-04-12T13:50:52.756Z","repository":{"id":11037457,"uuid":"13371694","full_name":"codebrainz/code-format","owner":"codebrainz","description":"A code formatting plugin for Geany using ClangFormat.","archived":false,"fork":false,"pushed_at":"2021-09-14T20:01:12.000Z","size":103,"stargazers_count":12,"open_issues_count":7,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T08:23:29.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/codebrainz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-06T23:51:25.000Z","updated_at":"2023-08-06T22:25:02.000Z","dependencies_parsed_at":"2022-08-28T19:50:42.506Z","dependency_job_id":null,"html_url":"https://github.com/codebrainz/code-format","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fcode-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fcode-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fcode-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fcode-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebrainz","download_url":"https://codeload.github.com/codebrainz/code-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248575598,"owners_count":21127213,"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-11-15T04:38:27.044Z","updated_at":"2025-04-12T13:50:52.734Z","avatar_url":"https://github.com/codebrainz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Geany Code Format Plugin\n========================\n\nThe Code Format plugin allows simple and precise formatting of\nC, C++ and Objective-C source code using the excellent utility\n`clang-format` provided as part of the `ClangTools`.\n\nFeatures\n--------\n\n* Accurate lexical code formatting using Clang frontend.\n* Runs `clang-format` as an external process so you can swap out and\nupgrade versions at will without touching the plugin.\n* Auto-formatting; never worry about formatting again, let the plugin\ndo all the work!\n* Can format current line, current selection, current document, or\nauto-format the entire document based on specified trigger characters.\n\nUsage\n-----\n\n### UI Functionality\n\nActivate the plugin using Geany's Plugin Manager dialog. Once activated\nit will place a new `Code Format` item in the `Tools` menu inside the\nmain menu. You can access basic functionality from here. The items and\nsubmenu's will automatically become enabled or disabled as certain\nfeatures cannot be used (ex. trying to format with no open documents or\ndocuments with unsupported filetypes).\n\n### Keybindings\n\nThere are two keybindings available, one to format the current\nselection (or current line if there is no selection), the other to\nformat the entire document. You can set the keybindings through Geany's\nmain Preferences dialog in the Keybindings tab.\n\n### Preferences\n\nThe preferences are broken into two parts. The first is a regular\n`.conf` file containing your settings for the Code Format plugin\nitself, like where to find the `clang-format` utility, or whether\nauto-formatting is enabled. The second type of preferences are those\nsepcified in `YAML` files and are read by the `clang-format` utility\nto control how the code is formatted. This section discusses the former.\n\nThe user preferences are stored in a file named `code-format.conf`\nfound in under the Geany configuration directory inside the `plugins`\ndirectory. The project-specific settings are stored inside the\nactual Geany project file (usally ends with `.geany`).\n\nIf a project is open, the project-specific preferences take effect and\ncan be changed using the Project Preferences dialog accessible through\nGeany's `Project` menu. If no project is opened, then the user\npreferences are used and can be changed using the Plugin Preferences\ndialog accessible through Geany's `Edit` menu. If you change the\nuser preferences while a project is open, the changes made won't take\neffect until there is no project open.\n\nIn the configuration files, Code Format settings are stored in the\n`[code-format]` group.\n\n#### ClangFormat Path\n\nThis setting specifies the path to the `clang-format` utility that\nis part of ClangTools. If the executable is found in the `PATH`\nenvironment variable, you can just put `clang-format` otherwise,\nyou can choose the full path to the binary. When a valid executable\nfile is found, an \"OK\" icon will appear in the text box, otherwise\nan \"error\" icon will appear. It only means that the file is found\nand is executable, not that it's actually `clang-format`.\n\nIn the configuration file, this setting is known as `clang-format-path`.\n\n#### Style\n\nThis setting controls whether to use one of the preset code formatting\nstyles available from `clang-format` or whether to use a Custom\n`.clang-format` file to control the code formatting style. If you\nselect one of the presets, you can click on the `Create` button to\nopen a new YAML document in Geany containing the code formatting\nsettings based on the selected item that you can tailor to suit\nyour specific code formatting style.\n\nIn the configuration file, this setting is known as `style` and can\nbe (at present) one of `llvm`, `google`, `chromium`, `mozilla` or\n`custom`.\n\n#### Format on Save\n\nThis setting controls whether the active document will be formatted just\nbefore Geany saves it. This is especially useful if you don't like to\nenable the auto-formatting option but still want mostly-automatic\nformatting of the code.\n\nIn the configuration file, this setting is known as `format-on-save`.\n\n#### Auto-Format\n\nThis setting controls whether the current document is formatted\nautomatically when one of a specific set of trigger characters are\ntyped. Even though it is not on by default, it is recommended that\nyou use this feature, and only turn if off if you find it annoying\nor it gets too slow on large documents.\n\nIn the configuration file, this setting is known as `auto-format`.\n\n#### Trigger Characters\n\nWhen `auto-format` is enabled, this setting controls the characters\nwhich when typed will cause the document to be re-formatted. The\ndefault set \"`)}];`\" seems to work well but you might like to\ncustomize these a bit. You probably don't want to use \"`\\n`\" (newline)\nor similar.\n\nIn the configuration file, this setting is known as\n`auto-format-trigger-chars`.\n\nClangFormat Information\n-----------------------\n\n[ClangFormat](http://clang.llvm.org/docs/ClangFormat.html) is part\nof the [ClangTools](http://clang.llvm.org/docs/ClangTools.html) set\nof utilities. You must install the `clang-format` utility in order\nto use the Code Format plugin for Geany. You can configure which\n`clang-format` executable gets used in the Preferences (see above).\nIt is **HIGHLY** recommended that you read the documentation for\n`clang-format` (at the above link) before using the Code Format\nplugin, in order to have any clue how it works.\n\nIt's important to note that various features documented or available\nthrough the user interface may not actually be supported by your\nversion of `clang-format`. It is recommended to always use the\nlatest version although it seems to handle unknown options and\nsuch gracefully.\n\n### Configuration\n\nIf you're using one of the preset code formatting styles (see\nPreferences), you basically don't have to configure anything for\n`clang-format`. The presets are equivalent to running:\n\n    $ clang-format -style=\u003cNAME_OF_STYLE\u003e ...\n\nWhere `\u003cNAME_OF_STYLE\u003e` is not equal to `file`.\n\nIf you're using a custom `.clang-format` file, you should configure it\nas per ClangFormat's documentation. It's a YAML file with readable\nnames and you should be able to figure it out while referencing the\nClangFormat documentation (at the above link). The custom configuration\nis equivalent to running:\n\n    $ clang-format -style=file ...\n\nThe special name `file` tells `clang-format` to read `.clang-format`\nfiles instead of using a preset.\n\nTo get started, you can base your custom configuration on one of the\npresets by using the \"Create\" button in the preferences dialog with\nthe desired preset selected in the list (see Preferences). The \"Create\"\nbutton is equivalent to running:\n\n    $ clang-format -style=\u003cSELECTED_PRESET\u003e -dump-config\n\nWhere `\u003cSELECTED_PRESET\u003e` is the preset chosen in the Style list when\nthe button is pressed. The output of the command is placed into a\nnew unsaved document named `.clang-format`. You should then save it in\na directory (see below) and customize it according to your needs.\n\nThe `.clang-format` file should be saved at or above the document(s)\nyou want formatting to work for. For example you can put it straight\ninto the source directory or you can put it at the root of your\nproject directory and it will affect all subdirectories (unless a\ncertain subdirectory has a `.clang-format` file as well). Because\nof this functionality, it is required that a document has been saved\non disk before so that the plugin can determine in which directory\nto start looking for `.clang-format` files. If you try and use the\nplugin on a new, never before saved document, the plugin simply\nwon't function and it will print some message to Geany's standard\noutput.\n\nAuthor and Contact\n------------------\n\nThe Code Format plugin was written by and is maintained by\nMatthew Brush \u003cmatt(at)geany(dot)org\u003e. You can report any issues\non the Github Issues page (TODO link) or provide any improvement\nby making a Pull Request on Github.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Fcode-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebrainz%2Fcode-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Fcode-format/lists"}