{"id":20971835,"url":"https://github.com/marco-m/roundtrip_ini","last_synced_at":"2025-09-25T22:59:18.659Z","repository":{"id":57710023,"uuid":"507640914","full_name":"marco-m/roundtrip_ini","owner":"marco-m","description":"decode, edit and encode the INI file format, preserving comments and blank lines","archived":false,"fork":false,"pushed_at":"2023-11-13T21:46:01.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-14T17:58:39.779Z","etag":null,"topics":["go","ini-file","parsing","roundtrip","structural-editing"],"latest_commit_sha":null,"homepage":"","language":"Go","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/marco-m.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}},"created_at":"2022-06-26T17:30:24.000Z","updated_at":"2023-11-13T20:12:39.000Z","dependencies_parsed_at":"2023-11-13T21:26:18.892Z","dependency_job_id":"37057ac7-9bb3-43d3-b7b7-2bd1f31e672a","html_url":"https://github.com/marco-m/roundtrip_ini","commit_stats":null,"previous_names":["marco-m/roundtrip_ini","marco-m/roundtripini"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marco-m/roundtrip_ini","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-m%2Froundtrip_ini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-m%2Froundtrip_ini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-m%2Froundtrip_ini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-m%2Froundtrip_ini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marco-m","download_url":"https://codeload.github.com/marco-m/roundtrip_ini/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marco-m%2Froundtrip_ini/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276994541,"owners_count":25741828,"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-09-25T02:00:09.612Z","response_time":80,"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":["go","ini-file","parsing","roundtrip","structural-editing"],"created_at":"2024-11-19T04:05:24.076Z","updated_at":"2025-09-25T22:59:18.626Z","avatar_url":"https://github.com/marco-m.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roundtrip_ini\n\n[![PkgGoDev](https://pkg.go.dev/github.com/marco-m/roundtrip_ini)](https://pkg.go.dev/github.com/marco-m/roundtrip_ini)\n\nDecode, structural edit (replace, insert, delete) and encode the [INI file] format, preserving comments and blank lines.\n\nHumans care about comments and blank lines and are confused when comments disappear or lines change place for no reason.\n\nModule `roundtrip_ini` is useful when you need to do round trip editing and\n\n* the diff is meant to be presented to a human for review.\n* the output is meant to be read or written again by a human.\n\nAt the same time, `roundtrip_ini` acts also as a formatter / pretty-printer, introducing uniformity. Like gofmt, the formatting is not tunable.\n\n## Status\n\n**Unstable, in development, version 0.x, the API will very likely change in a breaking way**.\n\n## Conformity and completeness\n\nThe [INI file] is an informal format and reaching conformity or completeness is _not_ a goal of this project.\n\n## Usage and examples\n\nThe idea is to have two packages:\n\n* Package `roundtrip_ini` performs **high-level** decoding, editing and encoding of the INI format, preserving comments and blank lines.\n* Package `ast` performs **low-level** decoding, editing and encoding of the INI format, preserving comments and blank lines.\n\nOne would normally use package `roundtrip_ini`, reserving package `ast` to special cases, but currently only package `ast` is implemented.\n\n* See the examples in ast/example_test.go.\n* See the tests.\n* See the [godoc-ast] API documentation for package `ast`, which has also the runnable examples.\n\n## Formatting\n\n* Spurious leading newlines are removed.\n* A trailing newline is added if missing.\n* Leading and trailing whitespace is removed from section names: `[ hello ]` becomes `[hello]`.\n* Properties are written as `foo = 42` (one space around the equal sign).\n\nSee `TestRoundTripCornerCases` and `TestRoundTripPrettyPrint` for details.\n\n## Comments and blank lines\n\nComments and blank lines are preserved as follows.\n\n* A comment is just above a section title or above a property. A comment can be multi-line.\n* Blank lines are just below a section title or below a property.\n\nSee the tests for details.\n\n## Contributing\n\n**Please, before working on a PR, open an issue to discuss your use case**.\n\nThis helps to better understand the pros and cons of a change and not to waste your time (and mine) developing a feature that for some reason doesn't fit well with the spirit of the project or could be implemented differently.\n\nThis is in the spirit of [minimalism] and [talk, then code].\n\n## Credits\n\nThanks to [participle], a parser and lexer generator.\n\n## License\n\nThis code is released under the MIT license, see file [LICENSE](LICENSE).\n\n[godoc-ast]: https://pkg.go.dev/github.com/marco-m/roundtrip_ini/ast\n[participle]: https://github.com/alecthomas/participle\n[INI file]: https://en.wikipedia.org/wiki/INI_file\n[talk, then code]: https://dave.cheney.net/2019/02/18/talk-then-code\n[minimalism]: https://www.britannica.com/art/Minimalism\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarco-m%2Froundtrip_ini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarco-m%2Froundtrip_ini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarco-m%2Froundtrip_ini/lists"}