{"id":18498329,"url":"https://github.com/softdevteam/rerun_except","last_synced_at":"2025-05-14T05:22:10.084Z","repository":{"id":54254145,"uuid":"188400226","full_name":"softdevteam/rerun_except","owner":"softdevteam","description":"Specify which files should not trigger a cargo rebuild","archived":false,"fork":false,"pushed_at":"2021-03-01T11:36:21.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-25T18:04:24.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softdevteam.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-24T10:10:03.000Z","updated_at":"2021-03-01T11:36:23.000Z","dependencies_parsed_at":"2022-08-13T10:10:22.058Z","dependency_job_id":null,"html_url":"https://github.com/softdevteam/rerun_except","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softdevteam%2Frerun_except","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softdevteam%2Frerun_except/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softdevteam%2Frerun_except/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softdevteam%2Frerun_except/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softdevteam","download_url":"https://codeload.github.com/softdevteam/rerun_except/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239217107,"owners_count":19601593,"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-06T13:38:45.776Z","updated_at":"2025-02-17T00:44:15.535Z","avatar_url":"https://github.com/softdevteam.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rerun_except\n\nSpecify which files should *not* trigger a `cargo` rebuild.\n\nIn normal operation, `cargo` rebuilds a project when any potentially relevant\nfile changes. One can use the\n[`rerun-if-changed`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#change-detection)\ninstruction to tell `cargo` to only rebuild if certain files are changed.\nHowever, it is easy to forget to add new files when using `rerun-if-changed`,\ncausing `cargo` not to rebuild a project when it should.\n\n`rerun_except` inverts this logic, causing `cargo` to rebuild a project when a\nfile changes *unless you explicitly ignored that file*. This is safer than\n`rerun-if-changed` because if you forget to explicitly ignore files, then\n`cargo` will still rebuild your project.\n\n`rerun_except` uses the [`ignore`](https://crates.io/crates/ignore) library to\nspecify which files to ignore in `gitignore` format. Note that explicit ignore\nfiles in your project (e.g. `.gitignore`) are implicitly added to the list of\nignored files.\n\nFor example if you have the following file layout:\n\n```text\nproj/\n  .gitignore\n  Cargo.toml\n  src/\n    lib.rs\n  lang_tests/\n    run.rs\n    test1.lang\n    test2.lang\n  target/\n    ...\n```\n\nand you do not want the two `.lang` files to trigger a rebuild then you would\ntell `rerun_except` to exclude `lang_tests/*.lang`. Assuming, as is common, that your\n`.gitignore` file also  the `target/` directory, then `rerun_except` will\nalso ignore the `target` directory. \n\nAdding a new file such as `lang_tests/test3.lang` will not trigger a rebuild\n(since it is covered by the ignore glob `lang_tests/*.lang`), but adding a new\nfile such as `build.rs` will trigger a rebuild (since it is not covered by an\nignore glob).\n\nTo use `rerun_except` in this manner you simply need to call\n`rerun_except::rerun_except` with an array of ignore globs in [`gitignore`\nformat](https://git-scm.com/docs/gitignore) as part of your `build.rs` file:\n\n```rust,ignore\nuse rerun_except::rerun_except;\n\nfn main() {\n    rerun_except(\u0026[\"lang_tests/*.lang\"]).unwrap();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftdevteam%2Frerun_except","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftdevteam%2Frerun_except","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftdevteam%2Frerun_except/lists"}