{"id":13672414,"url":"https://github.com/mgeisler/version-sync","last_synced_at":"2025-10-05T11:32:41.857Z","repository":{"id":25038086,"uuid":"103031149","full_name":"mgeisler/version-sync","owner":"mgeisler","description":"Keep version numbers in sync with Cargo.toml","archived":false,"fork":false,"pushed_at":"2024-05-25T10:17:37.000Z","size":229,"stargazers_count":73,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T11:59:26.574Z","etag":null,"topics":["rust","toml","versioning"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/mgeisler.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-10T13:24:15.000Z","updated_at":"2024-12-10T12:37:00.000Z","dependencies_parsed_at":"2024-04-29T02:38:03.198Z","dependency_job_id":"06f8cb47-5e80-4bda-b3b5-b8b9ba90112a","html_url":"https://github.com/mgeisler/version-sync","commit_stats":{"total_commits":199,"total_committers":9,"mean_commits":22.11111111111111,"dds":0.09045226130653261,"last_synced_commit":"c466d523b7bc1fd870bd7e5773358d9aa9dc30ff"},"previous_names":["mgeisler/check-versions"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgeisler%2Fversion-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgeisler%2Fversion-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgeisler%2Fversion-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgeisler%2Fversion-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgeisler","download_url":"https://codeload.github.com/mgeisler/version-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284951,"owners_count":20913704,"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":["rust","toml","versioning"],"created_at":"2024-08-02T09:01:34.865Z","updated_at":"2025-10-05T11:32:41.805Z","avatar_url":"https://github.com/mgeisler.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Keep your Version Numbers in Sync with Cargo.toml\n\n[![](https://github.com/mgeisler/version-sync/workflows/build/badge.svg)][build-status]\n[![](https://codecov.io/gh/mgeisler/version-sync/branch/master/graph/badge.svg)][codecov]\n[![](https://img.shields.io/crates/v/version-sync.svg)][crates-io]\n[![](https://docs.rs/version-sync/badge.svg)][api-docs]\n\nRust projects typically reference the crate version number in several places,\nsuch as the `README.md` file. The version-sync crate makes it easy to add an\nintegration test that checks that `README.md` is updated when the crate version\nchanges.\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dev-dependencies]\nversion-sync = \"0.9\"\n```\n\nThen create a `tests/version-numbers.rs` file with:\n\n```rust\n#[test]\nfn test_readme_deps() {\n    version_sync::assert_markdown_deps_updated!(\"README.md\");\n}\n\n#[test]\nfn test_html_root_url() {\n    version_sync::assert_html_root_url_updated!(\"src/lib.rs\");\n}\n```\n\nThis integration test will ensure that the dependencies mentioned in your\n`README.md` file are kept in sync with your crate version and that your\n`html_root_url` points to the correct documentation on docs.rs. If everything is\nwell, the test passes:\n\n```\n$ cargo test\n    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs\n     Running target/debug/deps/version_numbers-504f17c82f1defea\n\nrunning 2 tests\ntest test_readme_deps ... ok\ntest test_html_root_url ... ok\n\ntest result: ok. 2 passed; 0 failed; 0 ignored; 0 measured\n```\n\nIf the README or `html_root_url` is out of sync with the crate version, the\ntests fail. In this example, the crate is called `your-crate` and the version\nnumber in `Cargo.toml` has been changed to 0.2.0 while the `README.md` and\n`html_root_url` still use 0.1.2. The tests now fail and the problematic TOML\ncode and attribute are shown:\n\n```\n$ cargo test\n    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs\n     Running target/debug/deps/version_numbers-f399bac3e468d035\n\nrunning 2 tests\ntest test_readme_deps ... FAILED\ntest test_html_root_url ... FAILED\n\nfailures:\n\n---- test_readme_deps stdout ----\n\tChecking code blocks in README.md...\nREADME.md (line 20) ... expected minor version 2, found 1 in\n    [dev-dependencies]\n    your-crate = \"0.1\"\n\nthread 'test_readme_deps' panicked at 'dependency errors in README.md', tests/version-numbers.rs:6\nnote: Run with `RUST_BACKTRACE=1` for a backtrace.\n\n---- test_html_root_url stdout ----\n\tChecking doc attributes in src/lib.rs...\nsrc/lib.rs ... expected minor version 2, found 1 in\n    #![doc(html_root_url = \"https://docs.rs/your-crate/0.1.2\")]\n\nthread 'test_html_root_url' panicked at 'html_root_url errors in src/lib.rs', tests/version-numbers.rs:11\n\n\nfailures:\n    test_html_root_url\n    test_readme_deps\n\ntest result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured\n\nerror: test failed\n```\n\n### Excluding TOML Code\n\nYou can add `no_sync` to the language line in a code block to exclude it from\nthe checks done by `assert_markdown_deps_updated!`:\n\n````markdown\n```toml,no_sync\n[dependencies]\nyour_crate = \"0.1.2\"\n```\n````\n\n## Release History\n\nThis is a changelog describing the most important changes per release.\n\n### Version 0.9.5 (2023-09-09)\n\n- [#122](https://github.com/mgeisler/version-sync/pull/122): Use precise\n  dependency versions in `Cargo.toml`.\n- [#123](https://github.com/mgeisler/version-sync/pull/123): Migrate to the Rust\n  2021 edition.\n- [#126](https://github.com/mgeisler/version-sync/pull/126): Update syn to\n  latest version.\n- [#127](https://github.com/mgeisler/version-sync/pull/127): Update toml to\n  latest version.\n\n### Version 0.9.4 (2021-12-14)\n\n- [#115](https://github.com/mgeisler/version-sync/pull/115): Expand\n  `assert_markdown_deps_updated!` to also check version numbers such as\n  `=1.2.3`, `\u003e1.2.3`, and `\u003e=1.2.3`.\n- [#119](https://github.com/mgeisler/version-sync/pull/119): Add new\n  `assert_only_contains_regex!` macro which can ensure that all version numbers\n  in a file are updated.\n\n### Version 0.9.3 (2021-09-20)\n\n- [#108](https://github.com/mgeisler/version-sync/pull/108): Make all\n  dependencies optional. Thanks @rlee287!\n- [#109](https://github.com/mgeisler/version-sync/pull/109): Forbid the use of\n  unsafe code.\n- [#110](https://github.com/mgeisler/version-sync/pull/110): Add simple\n  `check_contains_version` function.\n\n### Version 0.9.2 (2021-02-13)\n\n- [#94](https://github.com/mgeisler/version-sync/pull/94): Update pulldown-cmark\n  to 0.8.\n- [#95](https://github.com/mgeisler/version-sync/pull/95): Fix `non_fmt_panic`\n  lint error in latest nightly.\n\n### Version 0.9.1 (2020-07-07)\n\n- [#91](https://github.com/mgeisler/version-sync/pull/91): Pull in fewer\n  dependencies. This optimizes the build time by 1-2 seconds.\n- [#92](https://github.com/mgeisler/version-sync/pull/92): Normalize `\\r\\n` to\n  `\\n` to ensure `^` and `$` always match line boundaries.\n\n### Version 0.9.0 (2020-03-30)\n\nDrop support for Rust 1.31.0 since our dependencies keep releasing new patch\npatch versions that push up the minimum required Rust version. At the time of\nwriting, the code compiles with Rust 1.36, but this will likely become outdated\nsoon.\n\nIssues closed:\n\n- [#83][issue-83]: version-sync fails to parse TOML blocks when inside\n  blockquotes\n- [#84][issue-84]: Release update to crates.io with syn 1.0\n\n### Version 0.8.1 (2019-04-03)\n\nDependencies were relaxed to make it easier to upgrade version-sync.\n\n### Version 0.8.0 (2019-03-28)\n\nWe now use [Rust 2018][rust-2018], which means we require Rust version 1.31.0 or\nlater. The `assert_html_root_url_updated!` macro will again report accurate line\nnumbers based on span information from the syn crate.\n\n### Version 0.7.0 (2019-01-14)\n\nSpecial characters are now correctly escaped in the `{name}` and `{version}`\nplaceholders in `assert_contains_regex!`.\n\nDependencies were updated and version-sync now requires Rust version 1.27.2 or\nlater.\n\n### Version 0.6.0 (2018-11-22)\n\nYou can use `assert_contains_regex!` to grep files for the current version\nnumber. The search is done with a regular expression where `{version}` is\nreplaced with the current version number.\n\nGit dependencies are now always accepted, which means that blocks like\n\n````markdown\n```toml\n[dependencies]\nyour_crate = { git = \"...\" }\n```\n````\n\nwill work without you having to add `no_sync`.\n\nIssues closed:\n\n- [#17][issue-17]: Allow to check non-markdown sources\n- [#39][issue-39]: Version 0.5 requires Rust version 1.21.0\n- [#42][issue-42]: Handle Git dependencies\n\n### Version 0.5.0 (2017-11-19)\n\nDependencies were updated and version-sync now requires Rust version 1.21 or\nlater.\n\nError messages from `assert_html_root_url_updated!` now again include line\nnumbers (based on a heuristic until the syn crate can provide the information).\n\n### Version 0.4.0 (2017-11-01)\n\nThis release replaces the dependency on the abandoned syntex_syntax with with a\ndependency on the much lighter syn crate. This improves compilation speed.\nUnfortunately, the syn crate does not provide information about line numbers, so\nerror messages are are no longer as good. We might be able to work around that\nin a later version.\n\n### Version 0.3.1 (2017-09-26)\n\nThis release fixes a small problem with the handling of pre-release identifiers.\n\nIssues closed:\n\n- [#19][issue-19]: Pre-release identifiers were ignored.\n\n### Version 0.3.0 (2017-09-23)\n\nWhen checking dependencies in READMEs, TOML blocks can now be excluded from the\ncheck by adding `no_sync` to the language line:\n\n````markdown\n```toml,no_sync\n[dependencies]\nyour_crate = \"0.1\"\n```\n````\n\nThis TOML block will not be checked. This is similar to `no_run` for Rust code\nblocks.\n\n### Version 0.2.0 (2017-09-20)\n\nAdded `assert_html_root_url_updated!` which will check that the `html_root_url`\nattribute points to the correct version of the crate documentation on docs.rs.\n\n### Version 0.1.3 (2017-09-18)\n\nFirst public release with support for finding outdated version numbers in\n`dependencies` and `dev-dependencies`.\n\nVersions 0.1.0 to 0.1.2 were released under the name check-versions.\n\n## License\n\nVersion-sync can be distributed according to the [MIT license][mit].\nContributions will be accepted under the same license.\n\n[build-status]: https://github.com/mgeisler/version-sync/actions?query=workflow%3Abuild+branch%3Amaster\n[codecov]: https://codecov.io/gh/mgeisler/version-sync\n[crates-io]: https://crates.io/crates/version-sync\n[api-docs]: https://docs.rs/version-sync/0.9/\n[rust-2018]: https://doc.rust-lang.org/edition-guide/rust-2018/\n[mit]: LICENSE\n[issue-17]: https://github.com/mgeisler/version-sync/issues/17\n[issue-19]: https://github.com/mgeisler/version-sync/issues/19\n[issue-39]: https://github.com/mgeisler/version-sync/issues/39\n[issue-42]: https://github.com/mgeisler/version-sync/issues/42\n[issue-83]: https://github.com/mgeisler/version-sync/issues/83\n[issue-84]: https://github.com/mgeisler/version-sync/issues/84\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgeisler%2Fversion-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgeisler%2Fversion-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgeisler%2Fversion-sync/lists"}