{"id":16414626,"url":"https://github.com/mattlqx/pre-commit-search-and-replace","last_synced_at":"2025-09-01T03:33:30.806Z","repository":{"id":52300200,"uuid":"141463616","full_name":"mattlqx/pre-commit-search-and-replace","owner":"mattlqx","description":"Plugin for pre-commit for arbitrary search and replace on committed files.","archived":false,"fork":false,"pushed_at":"2025-07-24T19:45:28.000Z","size":122,"stargazers_count":13,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T00:36:16.881Z","etag":null,"topics":["pre-commit"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/mattlqx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2018-07-18T16:49:13.000Z","updated_at":"2025-07-24T19:45:32.000Z","dependencies_parsed_at":"2024-03-23T20:21:49.967Z","dependency_job_id":"af570109-bb8c-421b-a247-6065ad671a4a","html_url":"https://github.com/mattlqx/pre-commit-search-and-replace","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/mattlqx/pre-commit-search-and-replace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlqx%2Fpre-commit-search-and-replace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlqx%2Fpre-commit-search-and-replace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlqx%2Fpre-commit-search-and-replace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlqx%2Fpre-commit-search-and-replace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattlqx","download_url":"https://codeload.github.com/mattlqx/pre-commit-search-and-replace/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattlqx%2Fpre-commit-search-and-replace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273069561,"owners_count":25040076,"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-01T02:00:09.058Z","response_time":120,"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":["pre-commit"],"created_at":"2024-10-11T06:54:39.726Z","updated_at":"2025-09-01T03:33:30.757Z","avatar_url":"https://github.com/mattlqx.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pre-commit-search-and-replace\n\nThis is a plugin for [pre-commit](https://pre-commit.com) that will run search and replace string operations against files to be committed. Note that this plugin operates on each line of a file therefore multiple line patterns are not supported.\n\n### Usage\n\nBy default, a YAML config file is loaded at `.pre-commit-search-and-replace.yaml` in the root of the repo. This config file should be a list of entries specifying any of the following keys:\n\n- `search`: (required) the string or regexp to search for. To use a regexp, start and end with slashes. e.g. `/^mypattern/`\n- `replacement`: the string to replace matched strings with. If specified, files will \"fixed\". Match groups can be referenced here (e.g. `\\1` or `\\k\u003cfoo\u003e`)\n- `insensitive`: boolean whether the regexp should be case-insensitive. default: `false`\n- `extended`: boolean whether the regexp should be extended. default: `false`\n- `description`: short text description of purpose of the entry.\n\nThe config file name can be changed by passing a `--config PATH` argument to the hook in the pre-commit config. A single search and replacement can be specified with `--search STRING` and `--replacement STRING` arguments as well instead of using a config file.\n\nOther command line args:\n- `--[no-]write` - Whether to write replacements to the file.\n- `--[no-]color` - Whether to have output be colorized.\n\nExample pre-commit config:\n\n    - repo: https://github.com/mattlqx/pre-commit-search-and-replace\n      rev: v1.1.9\n      hooks:\n      - id: search-and-replace\n\nExample search-and-replace config:\n\n    - search: /Something [bB]ad/\n      replacement: Something Good\n    - search: foobar\n      insensitive: true\n      replacement: FOOBAR\n    - search: JustFailIfThisStringIsFound\n\nOutput can look something like this:\n\n![example output](doc/example.png)\n\nSpecific lines in the committed files may be exempt from consideration by commenting as appropriate to the end of the line:\n\n```\n# no-search-replace\n\n// no-search-replace\n```\n\nOr these comment styles that support being anywhere in the line:\n\n```\n/* no-search-replace */\n\n\u003c!-- no-search-replace --\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattlqx%2Fpre-commit-search-and-replace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattlqx%2Fpre-commit-search-and-replace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattlqx%2Fpre-commit-search-and-replace/lists"}