{"id":46644086,"url":"https://github.com/jambolo/cargo-wrap-comments","last_synced_at":"2026-03-12T08:01:53.907Z","repository":{"id":342257683,"uuid":"1173403007","full_name":"jambolo/cargo-wrap-comments","owner":"jambolo","description":"Formats comments in Rust files so that comment lines are as long as possible and wrapped at the specified width. Some day rustfmt will do this, but this is a solution in the meantime.","archived":false,"fork":false,"pushed_at":"2026-03-08T20:13:50.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2026-03-09T07:55:50.367Z","etag":null,"topics":["cargo-subcommand","cli","code-formatting","comments","developer-tools","documentation","productivity","refactoring","rust","rustfmt"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/cargo-wrap-comments","language":"Rust","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/jambolo.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":"2026-03-05T10:25:54.000Z","updated_at":"2026-03-08T20:23:17.000Z","dependencies_parsed_at":"2026-03-09T05:04:44.515Z","dependency_job_id":null,"html_url":"https://github.com/jambolo/cargo-wrap-comments","commit_stats":null,"previous_names":["jambolo/comment_formatter","jambolo/cargo-wrap-comments"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jambolo/cargo-wrap-comments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jambolo%2Fcargo-wrap-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jambolo%2Fcargo-wrap-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jambolo%2Fcargo-wrap-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jambolo%2Fcargo-wrap-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jambolo","download_url":"https://codeload.github.com/jambolo/cargo-wrap-comments/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jambolo%2Fcargo-wrap-comments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30326878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"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":["cargo-subcommand","cli","code-formatting","comments","developer-tools","documentation","productivity","refactoring","rust","rustfmt"],"created_at":"2026-03-08T04:05:16.436Z","updated_at":"2026-03-10T06:00:41.201Z","avatar_url":"https://github.com/jambolo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cargo-wrap-comments\n\n[![Rust (master)](https://github.com/jambolo/cargo-wrap-comments/actions/workflows/rust.yml/badge.svg?branch=master)](https://github.com/jambolo/cargo-wrap-comments/actions/workflows/rust.yml?query=branch%3Amaster)\n[![Rust (develop)](https://github.com/jambolo/cargo-wrap-comments/actions/workflows/rust.yml/badge.svg?branch=develop)](https://github.com/jambolo/cargo-wrap-comments/actions/workflows/rust.yml?query=branch%3Adevelop)\n\nA Rust command-line tool that formats source code comments to wrap long lines at a specified width. This does what rustfmt should do.\n\n## Features\n\n- Wraps long comments to a configurable width (default: 100 characters)\n- Reads `max_width` from `.rustfmt.toml` or `rustfmt.toml` if `--max-width` is not specified\n- Combines consecutive comment lines before wrapping\n- Supports Rust comment styles: `//`, `///`, `//!`\n- Preserves indentation, comment markers, and blank comment lines\n- Respects hierarchical markers (`#`, `*`, `-`, `1.`, `A.`, `a.`), back-tick quoted text, and code blocks\n- Glob pattern support for processing multiple files\n- Stdin/stdout mode when no files are specified\n- Check mode for previewing changes without modifying files\n\n## Installation\n\n```sh\ncargo install cargo-wrap-comments\n```\n\n### From source\n\n```sh\ncargo build --release\n```\n\nThe binary will be at `target/release/cargo-wrap-comments`.\n\n## Usage\n\nThe tool can be run as a standalone command or as a Cargo subcommand:\n\n```sh\n# As a cargo subcommand\ncargo wrap-comments src/main.rs\n\n# As a standalone command\ncargo-wrap-comments src/main.rs\n\n# Format comments in multiple files with glob patterns\ncargo wrap-comments \"src/**/*.rs\"\n\n# Set custom width\ncargo wrap-comments --max-width 80 src/main.rs\n\n# Preview changes without modifying files\ncargo wrap-comments --check src/main.rs\n\n# Read from stdin, write to stdout\ncat src/main.rs | cargo wrap-comments\ncargo wrap-comments \u003c src/main.rs\n```\n\n## Options\n\n| Option                 | Description                      | Default |\n|------------------------|----------------------------------|---------|\n| `-w`, `--max-width N`  | Maximum line width               | 100     |\n| `--check`              | Preview mode, don't modify files |         |\n| `-v`, `--verbose`      | Print verbose output             |         |\n| `-q`, `--quiet`        | Print less output                |         |\n| `-V`, `--version`      | Show version information         |         |\n| `-h`, `--help`         | Show help                        |         |\n\n## Comment Combining Rules\n\nConsecutive comment lines are combined before wrapping when ALL of these are true:\n\n1. Same comment marker (`//`, `///`, or `//!`)\n2. Same indentation level\n3. Neither line is blank\n4. The next line does not start with a hierarchical marker: `#`, `*`, `-`, `` ``` ``, `1.`, `A.`, `a.`\n5. The current line does not contain a code fence marker (`` ``` ``)\n6. The current line does not start with `#` (markdown heading lines are not combined with the text that follows)\n\n## Width Resolution\n\nThe line width is resolved in this order:\n\n1. `--max-width N` on the command line\n2. `max_width` from `.rustfmt.toml` or `rustfmt.toml`, searching from the current directory up to `$HOME`\n3. Default: 100\n\nThe search stops at the first config file found. If it exists but has no `max_width`, the default is used.\n\n## Exit Codes\n\n- `0` — success\n- `1` — one or more errors occurred (missing files, processing failures)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjambolo%2Fcargo-wrap-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjambolo%2Fcargo-wrap-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjambolo%2Fcargo-wrap-comments/lists"}