{"id":22124181,"url":"https://github.com/federicoponzi/tlaplus-formatter","last_synced_at":"2025-10-30T02:56:06.870Z","repository":{"id":249435054,"uuid":"831453515","full_name":"FedericoPonzi/tlaplus-formatter","owner":"FedericoPonzi","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-03T20:12:07.000Z","size":432,"stargazers_count":7,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T21:23:52.360Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TLA","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FedericoPonzi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-20T15:40:12.000Z","updated_at":"2025-04-03T20:12:07.000Z","dependencies_parsed_at":"2024-12-19T15:36:35.742Z","dependency_job_id":null,"html_url":"https://github.com/FedericoPonzi/tlaplus-formatter","commit_stats":null,"previous_names":["federicoponzi/tlaplus-formatter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Ftlaplus-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Ftlaplus-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Ftlaplus-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FedericoPonzi%2Ftlaplus-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FedericoPonzi","download_url":"https://codeload.github.com/FedericoPonzi/tlaplus-formatter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173337,"owners_count":21059592,"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-12-01T15:46:49.006Z","updated_at":"2025-10-30T02:56:06.863Z","avatar_url":"https://github.com/FedericoPonzi.png","language":"TLA","funding_links":[],"categories":[],"sub_categories":[],"readme":"## TLA\u003csup\u003e+\u003c/sup\u003e formatter\n\n\u003cp align=\"center\"\u003e\u003cimg alt=\"temporary tla+ formatter logo\" src=\"assets/tlaplus-formatter-temp-logo.jpg\" width=\"250\"\u003e\u003c/p\u003e\n\nThis is a formatter for the TLA\u003csup\u003e+\u003c/sup\u003e language.\n\nIt uses tlaplus tools' SANY library to parse your specification, and it applies some (at the moment) predefined format\nto it.\n\nThis is still _ALPHA_ software, feel free to try it out and leave feedback but be aware it might break your specs.\n\n## Project Goals:\n\n* A formatter for the TLA+ language. Pluscal is currently not a priority.\n* It should be configurable but also provide sane defaults.\n* It should never add useless chars (no extra spaces or extra newlines)\n* It should never break any specs. No user configuration should ever lead to broken specs.\n* The output should be stable. Applying the formatter to the output of a previous formatter run should not change it.\n* It should be fast.\n\n## Configurations:\n\nIf you have specific requests for configuration options you would like to have, please consider opening an issue.\n\nCurrently, the idea is to follow the same ideas behind rustfmt. A user level formatter config and a project level\nformatter config.\n\n## Example\n\nTo see some examples of current reformatting, compare:\n\n* HourClock.tla:\n    * [before](https://github.com/FedericoPonzi/tlaplus-formatter/blob/main/src/test/resources/inputs/HourClock.tla)\n      and [after](https://github.com/FedericoPonzi/tlaplus-formatter/blob/main/src/test/resources/outputs/HourClock.tla)\n* TowerOfHanoi.tla:\n    * [before](https://github.com/FedericoPonzi/tlaplus-formatter/blob/main/src/test/resources/inputs/TowerOfHanoi.tla)\n      and [after](https://github.com/FedericoPonzi/tlaplus-formatter/blob/main/src/test/resources/outputs/TowerOfHanoi.tla)\n* Stones.tla:\n    * [before](https://github.com/FedericoPonzi/tlaplus-formatter/blob/main/src/test/resources/inputs/Stones.tla)\n      and [after](https://github.com/FedericoPonzi/tlaplus-formatter/blob/main/src/test/resources/outputs/Stones.tla)\n\nMore examples are in the test/java/resources/{inputs|outputs} folders. These sources are taken from the TLA+ Examples\nrepo.\n\n## Testing with TLA+-Smith\n\nThis project integrates [TLA+-Smith](https://github.com/fponzi/tlaplus-smith), a random TLA+ specification generator,\nfor comprehensive testing. TLA+-Smith helps ensure the formatter works correctly with a wide variety of TLA+ constructs\nand edge cases.\n\n## How to run\n\nIf you want to try it out, go to the build page of the latest commit and download the \"tlaplus-formatter-jar.zip\" file\nfrom the\nartifact section at the bottom of the\npage ([Example](https://github.com/FedericoPonzi/tlaplus-formatter/actions/runs/10027954925)).\n\nYou will need at least java 11 (the same requirement as tlatools).\n\nUnzip the file, and you can invoke the formatter like this:\n\n```\njava -jar tlaplus-formatter.jar \u003cINFILE\u003e [OUTFILE]\n```\n\nIt will print your reformatted spec in output. If the optional \"OUTFILE\" parameter is specified, it will write the\noutput to that file.\nYou can use the input file as the output file as well. Run with `-help` parameter for the help text.\n\n## VSCode integration\n\nIt's a work in progress, see [PR-327](https://github.com/tlaplus/vscode-tlaplus/pull/327/files) on vscode-tlaplus repo.\n\n## Limitations\n\nBecause it uses SANY underneath (TLC's parser), your spec needs to first succeed SANY's\nparsing process; otherwise the formatter won't be able to reformat your file.\n\n---\n\n## Development\n\nSome of the `constants` used in the code are coming from SANY's codebase, specifically from this file:\n`src/tla2sany/st/SyntaxTreeConstants.java` (check [tlaplus repo](https://github.com/tlaplus/tlaplus/)).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericoponzi%2Ftlaplus-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedericoponzi%2Ftlaplus-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedericoponzi%2Ftlaplus-formatter/lists"}