{"id":21939230,"url":"https://github.com/sloganking/scfmt","last_synced_at":"2025-03-22T14:43:39.086Z","repository":{"id":42005878,"uuid":"473750047","full_name":"sloganking/scfmt","owner":"sloganking","description":"A code formatter for structured comments","archived":false,"fork":false,"pushed_at":"2022-05-07T06:22:39.000Z","size":102,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T21:16:36.620Z","etag":null,"topics":["codeformatter","formatter","rust"],"latest_commit_sha":null,"homepage":"","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/sloganking.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}},"created_at":"2022-03-24T19:41:30.000Z","updated_at":"2022-04-29T20:26:59.000Z","dependencies_parsed_at":"2022-08-12T02:10:19.373Z","dependency_job_id":null,"html_url":"https://github.com/sloganking/scfmt","commit_stats":null,"previous_names":["sloganking/structured-commenting-formatter"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloganking%2Fscfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloganking%2Fscfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloganking%2Fscfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sloganking%2Fscfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sloganking","download_url":"https://codeload.github.com/sloganking/scfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244973695,"owners_count":20541022,"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":["codeformatter","formatter","rust"],"created_at":"2024-11-29T02:17:35.348Z","updated_at":"2025-03-22T14:43:39.064Z","avatar_url":"https://github.com/sloganking.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Structured commenting formatter (scfmt)\n\n``scfmt`` is a formatter designed to enable [structured commenting](https://github.com/sloganking/Structured-Commenting) in your code. Running ``scfmt`` after traditional code formatters, will ensure your structured comments are indented correctly and not mangled. This repository provides both a CLI for quickly formatting files, and a rust library for adding scfmt support to other projects.\n\n## Quick Links\n\n[FAQ](./FAQ.md)\n\n\n## Features\n\n### Formatting\n``scfmt`` will format strings with bracketed structured comments, so that their contents inside them are correctly indented.\n\n### Adding Brackets\nAdding brackets converts the bracketless method of structured commenting to the bracketed version. Strucutred comments must be bracketed before being run through the formatter, or else no change will take effect.\n\n### Removing Brackets\nRemoving brackets converts the bracketed method of structured commenting to the bracketless version. Bracketless structured comments are less verbose, but have no method of being recovered if their whitespace gets messed up. Say after running them through a traditional code formatter.\n\n### Nullifying Brackets\nNullifying brackets puts a ``_`` character in front of any existing bracketed comments. This allows for more easily converting existing projects to being compatible with structured commenting.\n\n\n## What is scfmt allowed to do?\n\nThe only things ``scfmt`` is allowed to do are: \n- Create and delete ``//\u003c`` closing comments\n- Add and remove brackets ``\u003e``, ``\u003c\u003e`` to the begining of existing comments.\n- Ensure empty lines are depth 0\n- Edit the indentation of lines for SC formatting.\n\nWhat will scfmt not do?\n- Turn one line into many\n- Turn many lines into one\n- Ensure a ``max_width``\n- Add or remove empty lines\n\n## Noteworthy bugs\n\n- Per [issue #1](https://github.com/sloganking/Structured-commenting-formatter/issues/1), ``scfmt`` will mistake lines in multi-line strings or multi-line comments, as strucutred comments if those lines start with your language's comment starter. This means multi-line strings and comments such as the one below would get formatted, even though they should not be.\n\n```rust\n/*\n//\u003e\ncomment line that will get indented after formatting\n//\u003c\n*/\n\nlet multi_line_str = \"\n//\u003e\nstring line that will get indented after formatting\n//\u003c\n\"\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloganking%2Fscfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsloganking%2Fscfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsloganking%2Fscfmt/lists"}