{"id":13489564,"url":"https://github.com/haaakon/SwiftFormat","last_synced_at":"2025-03-28T05:31:02.020Z","repository":{"id":74175096,"uuid":"21625867","full_name":"haaakon/SwiftFormat","owner":"haaakon","description":"Python script for auto formatting Swift code","archived":false,"fork":false,"pushed_at":"2015-06-11T20:53:43.000Z","size":796,"stargazers_count":114,"open_issues_count":1,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-31T03:33:37.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/haaakon.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}},"created_at":"2014-07-08T19:01:02.000Z","updated_at":"2023-09-28T19:09:58.000Z","dependencies_parsed_at":"2023-02-25T21:00:36.651Z","dependency_job_id":null,"html_url":"https://github.com/haaakon/SwiftFormat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haaakon%2FSwiftFormat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haaakon%2FSwiftFormat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haaakon%2FSwiftFormat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haaakon%2FSwiftFormat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haaakon","download_url":"https://codeload.github.com/haaakon/SwiftFormat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245978200,"owners_count":20703675,"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-07-31T19:00:31.026Z","updated_at":"2025-03-28T05:31:01.390Z","avatar_url":"https://github.com/haaakon.png","language":"Python","funding_links":[],"categories":["Libs"],"sub_categories":["Quality"],"readme":"SwiftFormat\n==============\n\nPython script for auto formatting Swift code, similar to Clang format.\n \n Current status: Gonna rewrite this to Swift.\n\n## Usage\n\n#### auto format a file\n```bash\nUsage: \n--file [FILE] The file to format\n--output [FILE] The file to write the formatted output to\n\npython format.py --file inputfilename.swift --output outputfilename.swift\n```\n### Demo\n\n![Demo script run](https://raw.githubusercontent.com/haaakon/SwiftFormat/b746a3d8e7e067faecc8997fc4b9acd17b5ecb5f/swiftformat.gif)\n\n### Contributing\n\nAll contributions are more than welcome, suggestions on how to move forward is appreciated.\n\n### Test format\nPut source code to be formatted above @@@, and under put the correct way it should be formatted after running the format script.\n\n```swift\nclass test() {{var str = \"teststr\" }}\n@@@\nclass test() {\n    {\n        var str = \"teststr\"\n    }\n}\n```\n\nFor each rule thats added, add a test file that shows how it should format correctly. The test checks that all files are formatted correctly as shown under the @@@ in their file.\n\n#### Run tests\n```bash\npython tests.py\nTEST OK for python/SwiftFormatter/testCases/indentation/indentTest.test\nTEST OK for python/SwiftFormatter/testCases/indentation/lotsOfCurlyBraces.test\nTEST OK for python/SwiftFormatter/testCases/indentation/mulitplemethodsinclass.test\nTEST OK for python/SwiftFormatter/testCases/indentation/prefixedSpaces.test\nTEST OK for python/SwiftFormatter/testCases/indentation/twoCurly.test\n```\n\n\n\n### TODO\n- Add alot more formatting rules\n- be able to turn rules on/off\n- add a plugin for xcode\n\n## License\nMIT\n### Author \nHåkon Bogen hakon.bogen@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaaakon%2FSwiftFormat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaaakon%2FSwiftFormat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaaakon%2FSwiftFormat/lists"}