{"id":39567805,"url":"https://github.com/lmichaudel/c3fmt","last_synced_at":"2026-04-26T23:00:49.553Z","repository":{"id":331257222,"uuid":"1123771312","full_name":"lmichaudel/c3fmt","owner":"lmichaudel","description":"A code formatter for the C3 language. Written in C3.","archived":false,"fork":false,"pushed_at":"2026-03-27T09:48:53.000Z","size":3753,"stargazers_count":19,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-27T21:08:01.117Z","etag":null,"topics":["c3","formatter"],"latest_commit_sha":null,"homepage":"","language":"C3","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/lmichaudel.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-27T15:32:29.000Z","updated_at":"2026-03-27T09:48:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lmichaudel/c3fmt","commit_stats":null,"previous_names":["lmichaudel/c3fmt"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/lmichaudel/c3fmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmichaudel%2Fc3fmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmichaudel%2Fc3fmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmichaudel%2Fc3fmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmichaudel%2Fc3fmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmichaudel","download_url":"https://codeload.github.com/lmichaudel/c3fmt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmichaudel%2Fc3fmt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32315712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T21:09:39.134Z","status":"ssl_error","status_checked_at":"2026-04-26T21:09:21.240Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c3","formatter"],"created_at":"2026-01-18T07:15:42.487Z","updated_at":"2026-04-26T23:00:49.545Z","avatar_url":"https://github.com/lmichaudel.png","language":"C3","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\".github/c3fmt_logo.png\" alt=\"logo banner\" width=\"40%\"\u003e\n\u003c/p\u003e\n\n#\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/lmichaudel/c3fmt/actions/workflows/main.yml/badge.svg\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/c3-v7.11-blue\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue\"\u003e\n\u003c/p\u003e\n\nA customizable code formatter for the C3 language, written in C3.\n\n## Usage\n\nUsage:\n```bash\nc3fmt [\u003coptions\u003e] \u003cfiles/directories\u003e\n```\nOptions:\n```\n-h, --help       - Show this help.\n-v, --version    - Show current version.\n--in-place       - Format files in place.\n--stdin          - Read input from stdin.\n--stdout         - Output result to stdout.\n--config=\u003cpath\u003e  - Specify a config file.\n--default        - Force default config.\n--check          - Finish with error if files are not formatted.\n```\n\n## Configuration\n\n`c3fmt` will try to find a `.c3fmt` configuration file inside the working directory. You can also pass your own path to `c3fmt` using the `--config` flag, or force the default configuration with `--default`.\n\nYou can look at [.c3fmt](.c3fmt) for the default configuration.\n\n### Available Options\n\n| Key | Description | Default |\n| --- | --- | --- |\n| `use_tabs` | Use tabs for indentation. | `true` |\n| `tab_size` | The width of a tab character. | `4` |\n| `indent_width` | The number of spaces to use for indentation (if `use_tabs` is false). | `4` |\n| `max_blank_line_between_statements` | Maximum number of blank lines to preserve between statements. | `2` |\n| `max_line_length` | Maximum line length before wrapping. | `120` |\n| `brace_style` | The brace style to use: `ALLMAN` or `K\u0026R`. | `ALLMAN` |\n| `else_on_newline` | Whether to put `else` on a new line. | `true` |\n| `align_assignments` | Align `=` and `=\u003e` in consecutive declarations/assignments. | `true` |\n| `align_comments` | Align trailing comments in consecutive lines. | `true` |\n## Building\n\nBuilding requires the [C3 compiler](https://c3-lang.org/) and the [tree-sitter](https://github.com/tree-sitter/tree-sitter) SDK library. For instructions on how to build and install the tree-sitter library, refer to the [tree-sitter getting started guide](https://tree-sitter.github.io/tree-sitter/using-parsers/1-getting-started.html).\n\nTo build the executable:\n```bash\nc3c build\n```\n\nIf the `tree-sitter` library is not in your system's default search path, you can specify the path using the `-L` flag:\n\n```bash\nc3c build -L /path/to/tree-sitter/lib\n```\n\nThe binary will be located in `build/c3fmt`.\n\n### Updating Sources\n\nYou can keep the project dependencies and test data up-to-date using the built-in `prepare` targets:\n\n*   **Tree-sitter Grammar:** Update the C3 grammar parser from upstream.\n    ```bash\n    c3c build update-grammar --trust=full\n    ```\n*   **Standard Library:** Sync `test/stdlib/src` with the latest C3 standard library for stability testing.\n    ```bash\n    c3c build update-stdlib --trust=full\n    ```\n\n## Tests\n\nRun all tests using the C3 compiler:\n```bash\nc3c test\n```\n\nJust like with the build command, if `tree-sitter` is not in your search path, use the `-L` flag:\n```bash\nc3c test -L /path/to/tree-sitter/lib\n```\n\nThe test suite includes:\n- **Corpus**: Compares formatted output against expected `_f.c3` files.\n- **Stability**: Ensures that formatting already-formatted code produces no changes (idempotency).\n- **Stdlib**: Formats the entire C3 standard library and verifies that it still compiles and maintains the same syntax tree.\n\n## Vendored libraries\n\n- `src/opt.c3`: A vendored copy of [getopt.c3l](https://github.com/NotsoanoNimus/getopt.c3l).\n- `lib/tree_sitter.c3l`: C3 bindings for the core tree-sitter SDK.\n- `lib/tree_sitter_c3.c3l`: C3 grammar bindings for tree-sitter.\n\n## Planned features / wishlist\n\n- Wrapping indent option (ContinuationIndentWidth).\n- Import sorting.\n- Pointer alignment calibration.\n\n## Known issues\n\n*(none yet)*\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmichaudel%2Fc3fmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmichaudel%2Fc3fmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmichaudel%2Fc3fmt/lists"}