{"id":18973346,"url":"https://github.com/cyangle/post_process","last_synced_at":"2026-04-07T21:30:18.241Z","repository":{"id":119846684,"uuid":"432044729","full_name":"cyangle/post_process","owner":"cyangle","description":"Post process code generated by OpenAPI Generator","archived":false,"fork":false,"pushed_at":"2023-11-11T03:18:04.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-01T08:41:44.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/cyangle.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}},"created_at":"2021-11-26T03:38:50.000Z","updated_at":"2021-12-01T01:17:01.000Z","dependencies_parsed_at":"2023-06-03T08:45:21.646Z","dependency_job_id":null,"html_url":"https://github.com/cyangle/post_process","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyangle%2Fpost_process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyangle%2Fpost_process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyangle%2Fpost_process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyangle%2Fpost_process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyangle","download_url":"https://codeload.github.com/cyangle/post_process/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239970678,"owners_count":19727014,"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-11-08T15:11:53.754Z","updated_at":"2026-04-07T21:30:18.200Z","avatar_url":"https://github.com/cyangle.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# post_process\n\nPost process code generated by OpenAPI Generator.\n\nOften, you want to slightly modify the code generated by OpenAPI Generator with a few find and replace tasks.\n\n`post_process` automates this process with a configuration file.\n\nIt might support more task types in the future.\n\n## Installation\n\n### Install from Git\n\nAdd the following to shard.yaml\n\n```yaml\ndevelopment_dependencies:\n  post_process:\n    github: cyangle/post_process\n    version: ~\u003e 0.2.3\n```\n\n## Usage\n\nRun `post_process` binary within your project to find and replace strings with regex patterns.\n\n## Configuration\n\nDefault configuration file is `.post_process.yml`.\nIt allows to configure multiple find and replace tasks.\n\nAll changes are applied sequentially in the order specified in the configuration file.\n\nExample configuration file:\n\n```yaml\ntasks: # Required, an array of find and replace tasks.\n  - name: \"update api files\" # Required, name of the task.\n    file_glob: './src/google_drive/api/*.cr' # Required, file path glob pattern for the files to be processed.\n    changes: # Required, an array of changes you want to make to the files\n      -\n        name: 'Remove common method prefix \"drive_[api_name]_\"' # Required, name of the change\n        pattern: 'drive_%{api_name}_' # Required, string template for the regex pattern to find strings to change, supports interpolation.\n        new_value: '' # Required, string template for the new string to replace the ones found by the pattern, supports interpolation.\n        multi_line: false # Optional, whether to match multiple lines, default to false.\n      -\n        name: 'Restore operation name' # Required, name of the change\n        pattern: 'operation: \"%{capitalized_api_name}Api.' # Required, string template for the regex pattern to find strings to change, supports interpolation.\n        new_value: 'operation: \"%{capitalized_api_name}Api.drive_%{api_name}_' # Required, string template for the new string to replace the ones found by the pattern, supports interpolation.\n\n```\n\nFor each file, before processing, `pattern` and `new_value` would be interpolated with below two variables:\n\n- `api_name`\n- `capitalized_api_name`\n\nGiven example file path `src/google_drive/api/files_api.cr`, the `api_name` for this file is `files`, and the `capitalized_api_name` for this file is `Files`.\n\nthe above configuration file after interpolation:\n\n```yaml\ntasks: # Required, an array of find and replace tasks.\n  - name: \"update api files\" # Required, name of the task.\n    file_glob: './src/google_drive/api/files_api.cr' # Required, file path glob pattern for the files to be processed.\n    changes: # Required, an array of changes you want to make to the files\n      -\n        name: 'Remove common method prefix \"drive_[api_name]_\"' # Required, name of the change\n        pattern: 'drive_files_' # Required, string template for the regex pattern to find strings to change, supports interpolation.\n        new_value: '' # Required, string template for the new string to replace the ones found by the pattern, supports interpolation.\n        multi_line: false # Optional, whether to match multiple lines, default to false.\n      -\n        name: 'Restore operation name' # Required, name of the change\n        pattern: 'operation: \"FilesApi.' # Required, string template for the regex pattern to find strings to change, supports interpolation.\n        new_value: 'operation: \"FilesApi.drive_files_' # Required, string template for the new string to replace the ones found by the pattern, supports interpolation.\n\n```\n\n## Development\n\nInstall dependencies\n\n```shell\nshards\n```\n\nRun the tests:\n\n```shell\ncrystal spec\n```\n\nRun lints\n\n```shell\n./bin/ameba\ncrystal tool format --check\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/cyangle/post_process/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Chao Yang](https://github.com/cyangle) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyangle%2Fpost_process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyangle%2Fpost_process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyangle%2Fpost_process/lists"}