From ffd936d6819c6ea108c300f4c78e6c1fc7641d4a Mon Sep 17 00:00:00 2001 From: Tamme Schichler Date: Fri, 1 Oct 2021 13:55:14 +0200 Subject: [PATCH] Updated rust-template to version 14 --- .gitattributes | 1 + .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/dependabot.yml | 12 +- .github/workflows/auto-approve_dependabot.yml | 2 +- .github/workflows/deny_warnings.yml | 6 +- .github/workflows/rust_auto_format.yml | 2 +- .github/workflows/update_labels.yml | 23 ++ .rust-template.version.txt | 2 +- CODEOWNERS | 4 + CONTRIBUTING.md | 90 +++++++- Cargo.lock | 42 ++-- Cargo.toml | 6 +- README.md | 12 +- SECURITY.md | 6 +- labels.json | 202 ++++++++++++++++++ rustfmt.toml | 2 +- src/lib.rs | 1 + tests/meta_badges.rs | 11 + tests/meta_cargo_badges.rs | 10 +- tests/unincluded_meta_codeowners.rs | 10 + 21 files changed, 396 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/update_labels.yml create mode 100644 CODEOWNERS create mode 100644 labels.json create mode 100644 tests/unincluded_meta_codeowners.rs diff --git a/.gitattributes b/.gitattributes index 4b1f01b..a6167e2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,7 @@ *.md text eol=lf *.rs text eol=lf *.toml text eol=lf +*.txt text eol=lf *.yml text eol=lf .editorconfig text eol=lf diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 97fd7f2..2640757 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug Report about: Create a report to help this project improve title: '' -labels: bug +labels: 'type: bug' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 545016e..881bd08 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature Request about: Suggest an idea for this project title: '' -labels: enhancement +labels: 'type: feature' assignees: '' --- diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9b58378..f48da27 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,15 +4,19 @@ updates: directory: "/" schedule: interval: "daily" + # versioning-strategy: "increase-if-necessary" # Not yet supported. See . assignees: - "Tamschi" - reviewers: - - "Tamschi" + labels: + - "type: upkeep" + - "domain: Rust" + - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" assignees: - "Tamschi" - reviewers: - - "Tamschi" + labels: + - "type: upkeep" + - "domain: GitHub Actions" diff --git a/.github/workflows/auto-approve_dependabot.yml b/.github/workflows/auto-approve_dependabot.yml index 9a029ab..3f0565a 100644 --- a/.github/workflows/auto-approve_dependabot.yml +++ b/.github/workflows/auto-approve_dependabot.yml @@ -14,7 +14,7 @@ jobs: if: github.actor == 'dependabot[bot]' steps: - name: auto-approve - uses: actions/github-script@v4.0.2 + uses: actions/github-script@v5 with: # The default token is enough to comment, but Dependabot will only comply if you impersonate a user with write access. github-token: ${{secrets.AUTO_APPROVE_DEPENDABOT_TOKEN}} diff --git a/.github/workflows/deny_warnings.yml b/.github/workflows/deny_warnings.yml index f272440..89462b6 100644 --- a/.github/workflows/deny_warnings.yml +++ b/.github/workflows/deny_warnings.yml @@ -17,6 +17,6 @@ jobs: profile: minimal components: clippy - run: cat CI.toml >> Cargo.toml - - run: cargo clippy --workspace --locked --no-default-features -- -D warnings - - run: cargo clippy --workspace --locked -- -D warnings - - run: cargo clippy --workspace --locked --all-features -- -D warnings + - run: cargo clippy --workspace --locked --all-targets --no-default-features -- -D warnings + - run: cargo clippy --workspace --locked --all-targets -- -D warnings + - run: cargo clippy --workspace --locked --all-targets --all-features -- -D warnings diff --git a/.github/workflows/rust_auto_format.yml b/.github/workflows/rust_auto_format.yml index 94682d3..2768831 100644 --- a/.github/workflows/rust_auto_format.yml +++ b/.github/workflows/rust_auto_format.yml @@ -28,7 +28,7 @@ jobs: - run: cat CI.toml >> Cargo.toml - run: cargo +nightly fmt --all - - uses: stefanzweifel/git-auto-commit-action@v4.11.0 + - uses: stefanzweifel/git-auto-commit-action@v4.12.0 with: commit_message: Automatic formatting commit (cargo +nightly fmt) file_pattern: '**/*.rs' diff --git a/.github/workflows/update_labels.yml b/.github/workflows/update_labels.yml new file mode 100644 index 0000000..124830d --- /dev/null +++ b/.github/workflows/update_labels.yml @@ -0,0 +1,23 @@ +# labels.json adapted from . +# See also . + +name: Update Labels +on: + push: + branches: [develop] + +jobs: + deny-warnings: + name: Update Labels + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/.npm # I'm not entirely sure this is correct. + key: ${{ runner.os }}-npm + - run: npx github-label-sync + --access-token ${{ secrets.GITHUB_TOKEN }} + --labels labels.json + --allow-added-labels + ${{ github.repository }} diff --git a/.rust-template.version.txt b/.rust-template.version.txt index ec63514..8351c19 100644 --- a/.rust-template.version.txt +++ b/.rust-template.version.txt @@ -1 +1 @@ -9 +14 diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..1cf06c6 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,4 @@ +# See +# or . + +* @Tamschi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8122ab..139981c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,11 +35,11 @@ Please keep your code human-readable. While there are no formal style requirements, here are some suggestions that might help new code fit in with with the existing: -* Don't use abbreviations unless they are established terms. +- Don't use abbreviations unless they are established terms. They usually make it harder for me to read the code fluently. You also don't need to worry about alignment; I use a proportional font and likely wouldn't notice. -* Try to keep it simple. +- Try to keep it simple. I can't properly review code I don't understand, so straightforward implementations are usually preferred. @@ -47,9 +47,19 @@ While there are no formal style requirements, here are some suggestions that mig If you do something custom that's tricky, a link to an explanation of the technique would be nice. I'll just ask if this becomes an issue, though. -* If you use macros, put them nearby. +- If you use macros, put them nearby. - I normally place one-off macros directly above the item I need them for. + I normally place one-off macros directly above the item I need them for. + +- When writing comments and documentation, try to break lines semantically. + + It's more readable than breaking purely by line width this way, in my eyes. + + Just after commas tends to be a good place for this, of course, + but please try to also take sentence flow into account when there are none. + If there are multiple sentences in a paragraph, you may want to put them in separate lines. + + Please do not manually break lines in the rendered documentation (trailing double-space), unless this strongly improved legibility. ### Meta data @@ -58,3 +68,75 @@ Please add yourself to each copyright holders list of [LICENSE-APACHE](LICENSE-A Nicknames and entries without email addresses are fine, too. For substantial contributions (basically anything more than typo or grammar fixes), feel free to add yourself to the `authors` list in `Cargo.toml`. This explicitly includes documentation changes, testing and bug fixes that just happen to be not much code. + +## Labels + +Don't worry about these too much. + +You're encouraged to add any that seem applicable where possible, +but I'll otherwise just take care of it. + +(Don't undo changes I make to labels without immediate reason.) + +See for details on individual labels. + +### Categories + +- Assorted + + Labels without prefix like [`breaking`](https://github.com/Tamschi/TODO_CRATE_NAME/labels/breaking), + [`good first issue`](https://github.com/Tamschi/TODO_CRATE_NAME/labels/good%20first%20issue) or + [`help wanted`](https://github.com/Tamschi/TODO_CRATE_NAME/labels/help%20wanted). + +- `domain:` + + Categorises changes by domain. Mostly not necessary. + +- `effort:` + + Relative effort required. There's no specific unit of measurement. + +- `priority:` + + Vaguely informs my schedule, **cross-respository**. + + You're welcome to let me know that (and ideally why) you'd like to see a specific change and I'll take that into account. + + If you *need* a feature that you're not planning to implement yourself, strongly consider paying me for it. + + > This is, of course, subject to side-job restrictions I may be under. + + + + > If you'd like to pay me directly, contact me first and we'll figure out how to do this as industry-standard contract work. + > + > Alternatively: + > + > For crowdfunding and escrow, [Bountysource](https://www.bountysource.com/) seems reasonably trustworthy. This also has the advantage of letting someone else work on it, since I'm usually pretty swamped with projects. + > + > Use fiat bounties. Cryptoscam "currencies" are a scourge. + > + > Posting a bounty won't guarantee I'll actually implement a solution, but I'll try to speedily triage relevant issues at least. + > + > I'll try to set up something that automatically announces bounties, + > but if that doesn't happen within a few hours, **do** post a comment about it! + +- `state:` + + General scheduling categories. See label descriptions for details! + + Rarely, more than one may be applicable. + +- `type:` + + General problem or change domain categories. + + Only one of these should be used at a time. + +- `work:` + + These are inspired by the [Cynefin framework](https://en.wikipedia.org/wiki/Cynefin_framework) to categorise the type of work done or required. + + I adjusted the labels to be a bit friendlier and more expressive. See the label descriptions for details. + + The unknown category at the centre is not labelled explicitly. diff --git a/Cargo.lock b/Cargo.lock index 5f0c2fa..a852188 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "TODO_CRATE_NAME" version = "0.0.1" @@ -86,9 +88,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.51" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] @@ -270,9 +272,9 @@ dependencies = [ [[package]] name = "version-sync" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cb94ca10ca0cf44f5d926ac977f0cac2d13e9789aa4bbe9d9388de445e61028" +checksum = "a7a3e43f07cfb6ad1a7f6fedaf1144e59750b728c04a24a053035379b2e4584d" dependencies = [ "proc-macro2", "pulldown-cmark", @@ -291,9 +293,9 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "wasm-bindgen" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -301,9 +303,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", "lazy_static", @@ -316,9 +318,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.24" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -328,9 +330,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -338,9 +340,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ "proc-macro2", "quote", @@ -351,15 +353,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "wasm-bindgen-test" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cab416a9b970464c2882ed92d55b0c33046b08e0bdc9d59b3b718acd4e1bae8" +checksum = "96f1aa7971fdf61ef0f353602102dbea75a56e225ed036c1e3740564b91e6b7e" dependencies = [ "console_error_panic_hook", "js-sys", @@ -371,9 +373,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.24" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4543fc6cf3541ef0d98bf720104cc6bd856d7eba449fd2aa365ef4fed0e782" +checksum = "6006f79628dfeb96a86d4db51fbf1344cd7fd8408f06fc9aa3c84913a4789688" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 34c4085..78cecee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,11 +27,11 @@ publish = false [badges] is-it-maintained-issue-resolution = { repository = "Tamschi/TODO_CRATE_NAME" } is-it-maintained-open-issues = { repository = "Tamschi/TODO_CRATE_NAME" } -maintenance = { status = "experimental" } +maintenance = { status = "experimental" } # This may differ between branches. [dev-dependencies] cargo-husky = "1.5.0" doc-comment = "0.3.3" git_info = "0.1.2" -version-sync = "0.9.1" -wasm-bindgen-test = "0.3.24" +version-sync = "0.9.3" +wasm-bindgen-test = "0.3.28" diff --git a/README.md b/README.md index ebe23e9..cd93eff 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ [![GitHub](https://img.shields.io/static/v1?logo=GitHub&label=&message=%20&color=grey)](https://github.com/Tamschi/TODO_CRATE_NAME) [![open issues](https://img.shields.io/github/issues-raw/Tamschi/TODO_CRATE_NAME)](https://github.com/Tamschi/TODO_CRATE_NAME/issues) [![open pull requests](https://img.shields.io/github/issues-pr-raw/Tamschi/TODO_CRATE_NAME)](https://github.com/Tamschi/TODO_CRATE_NAME/pulls) +[![good first issues](https://img.shields.io/github/issues-raw/Tamschi/TODO_CRATE_NAME/good%20first%20issue?label=good+first+issues)](https://github.com/Tamschi/TODO_CRATE_NAME/contribute) + [![crev reviews](https://web.crev.dev/rust-reviews/badge/crev_count/TODO_CRATE_NAME.svg)](https://web.crev.dev/rust-reviews/crate/TODO_CRATE_NAME/) TODO_README_DESCRIPTION @@ -33,9 +35,9 @@ cargo add TODO_CRATE_NAME Licensed under either of -* Apache License, Version 2.0 +- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or ) -* MIT license +- MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. @@ -46,6 +48,8 @@ Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. +See [CONTRIBUTING](CONTRIBUTING.md) for more information. + ## [Code of Conduct](CODE_OF_CONDUCT.md) ## [Changelog](CHANGELOG.md) @@ -54,9 +58,9 @@ dual licensed as above, without any additional terms or conditions. `TODO_CRATE_NAME` strictly follows [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) with the following exceptions: -* The minor version will not reset to 0 on major version changes (except for v1). +- The minor version will not reset to 0 on major version changes (except for v1). Consider it the global feature level. -* The patch version will not reset to 0 on major or minor version changes (except for v0.1 and v1). +- The patch version will not reset to 0 on major or minor version changes (except for v0.1 and v1). Consider it the global patch level. This includes the Rust version requirement specified above. diff --git a/SECURITY.md b/SECURITY.md index 86d58f1..fa5ae06 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,9 +2,9 @@ ## Supported Versions -| Version | Supported | -| ------- | ------------------ | -| 0.0.1 | :white_check_mark: | +| Version | Supported | ***Initial*** Reason for Removal | +| ------- | ------------------ | -------------------------------- | +| 0.0.1 | :white_check_mark: | | Faulty versions are [yanked](https://doc.rust-lang.org/cargo/commands/cargo-yank.html), where possible after a Semver-compatible update is made available, and added to the table above as unsupported. They are also marked with an additional `v….….…-yanked` tag in Git to make them easily recognisable, but original release tags are not removed. diff --git a/labels.json b/labels.json new file mode 100644 index 0000000..646f6b4 --- /dev/null +++ b/labels.json @@ -0,0 +1,202 @@ +[ + { + "name": "breaking", + "color": "d73a4a", + "description": "Introduces or requests a breaking change." + }, + { + "name": "good first issue", + "color": "7057ff", + "description": "Good for newcomers" + }, + { + "name": "help wanted", + "color": "008672", + "description": "Extra attention is needed" + }, + { + "name": "effort: 1", + "color": "91ca55", + "description": "Relative effort required. There's no specific unit of measurement." + }, + { + "name": "effort: 2", + "color": "c2e2a2", + "description": "Relative effort required. There's no specific unit of measurement." + }, + { + "name": "effort: 3", + "color": "e9f4dc", + "description": "Relative effort required. There's no specific unit of measurement." + }, + { + "name": "effort: 5", + "color": "fef6d7", + "description": "Relative effort required. There's no specific unit of measurement." + }, + { + "name": "effort: 8", + "color": "fef2c0", + "description": "Relative effort required. There's no specific unit of measurement." + }, + { + "name": "effort: 13", + "color": "fbca04", + "description": "Relative effort required. There's no specific unit of measurement." + }, + { + "name": "priority: first", + "color": "d73a4a", + "description": "I'll try to take care of this soon-ish if nobody else does." + }, + { + "name": "priority: next", + "color": "ffb8c6", + "description": "I'll probably get to it, eventually." + }, + { + "name": "priority: someday", + "color": "000000", + "description": "If you need this, please let me know!" + }, + { + "name": "state: approved", + "color": "91ca55", + "description": "Approved to proceed." + }, + { + "name": "state: blocked", + "color": "ffffff", + "description": "Something is blocking action (aside from pure proceedings or missing information).", + "aliases": [ + "wontfix" + ] + }, + { + "name": "state: pending", + "color": "fbca04", + "description": "Waiting on other proceedings (aside from information)" + }, + { + "name": "state: inactive", + "color": "000000", + "description": "No action needed or possible. The issue is either fixed or addressed better by other issues.", + "aliases": [ + "duplicate" + ] + }, + { + "name": "state: question", + "color": "d876e3", + "description": "Further information is requested", + "aliases": [ + "question" + ] + }, + { + "name": "state: denied", + "color": "e4e669", + "description": "It could just be out of scope, but either way it won't be implemented here.", + "aliases": [ + "invalid" + ] + }, + { + "name": "type: bug", + "color": "d73a4a", + "description": "Something isn't working as expected", + "aliases": [ + "bug" + ] + }, + { + "name": "type: upkeep", + "color": "0366d6", + "description": "Converting measurements, reorganizing folder structure, and other necessary tasks.", + "aliases": [ + "dependencies" + ] + }, + { + "name": "type: documentation", + "color": "fef2c0", + "description": "Related to documentation and information.", + "aliases": [ + "documentation" + ] + }, + { + "name": "type: feature", + "color": "5ebeff", + "description": "Brand new functionality, features, pages, workflows, endpoints, etc.", + "aliases": [ + "enhancement" + ] + }, + { + "name": "type: fix", + "color": "91ca55", + "description": "Iterations on existing features or infrastructure" + }, + { + "name": "type: security", + "color": "d73a4a", + "description": "Something is vulnerable or not secure" + }, + { + "name": "type: testing", + "color": "fbca04", + "description": "Related to testing" + }, + { + "name": "work: novel", + "color": "fbca04", + "description": "There's a problem, and both goal and solution are unclear." + }, + { + "name": "work: emergent", + "color": "d4c5f9", + "description": "The goal isn't known, but a plan exists." + }, + { + "name": "work: complicated", + "color": "ffb8c6", + "description": "A specific goal already exists, but the path there isn't certain." + }, + { + "name": "work: clear", + "color": "91ca55", + "description": "A known solution is (to be) implemented." + }, + { + "name": "domain: Rust", + "color": "000000", + "description": "Involves Rust code.", + "aliases": [ + "rust" + ] + }, + { + "name": "domain: GitHub Actions", + "color": "000000", + "description": "Involves GitHub Actions.", + "aliases": [ + "github_actions" + ] + }, + { + "name": "Hacktoberfest", + "color": "91A88C", + "description": "A good-for-Hacktoberfest issue. This label is only maintained in October." + }, + { + "name": "hacktoberfest-accepted", + "color": "A88771", + "description": "Thank you for your contribution!" + }, + { + "name": "spam", + "color": "F74700", + "description": "Measure of last resort for Hacktoberfest purposes. Don't use this otherwise." + } +] \ No newline at end of file diff --git a/rustfmt.toml b/rustfmt.toml index 3f309b7..cc9988c 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -4,4 +4,4 @@ use_field_init_shorthand = true use_try_shorthand = true unstable_features = true -merge_imports = true +imports_granularity = "Crate" diff --git a/src/lib.rs b/src/lib.rs index 182c227..91a5ca7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![doc(html_root_url = "https://docs.rs/TODO_CRATE_NAME/0.0.1")] #![warn(clippy::pedantic)] +#![allow(clippy::semicolon_if_nothing_returned)] #[cfg(doctest)] pub mod readme { diff --git a/tests/meta_badges.rs b/tests/meta_badges.rs index fdaaeec..6e51ce6 100644 --- a/tests/meta_badges.rs +++ b/tests/meta_badges.rs @@ -119,6 +119,17 @@ fn pulls() { ); } +#[test] +fn good_first_issues() { + version_sync::assert_contains_regex!( + "README.md", + &format!( + r"^\[!\[good first issues\]\(https://img\.shields\.io/github/issues-raw/{0}/{{name}}/good%20first%20issue\?label=good\+first\+issues\)\]\(https://github\.com/{0}/{{name}}/contribute\)$", + USER, + ) + ); +} + #[test] fn crev() { version_sync::assert_contains_regex!( diff --git a/tests/meta_cargo_badges.rs b/tests/meta_cargo_badges.rs index 683d9cd..81259a4 100644 --- a/tests/meta_cargo_badges.rs +++ b/tests/meta_cargo_badges.rs @@ -9,7 +9,7 @@ fn is_it_maintained_issue_resolution() { version_sync::assert_contains_regex!( "Cargo.toml", &format!( - r#"^is-it-maintained-issue-resolution = \{{ repository = "{0}/{{name}}" \}}$"#, + r#"^is-it-maintained-issue-resolution = \{{ repository = "{0}/{{name}}" \}}"#, USER, ) ); @@ -20,7 +20,7 @@ fn is_it_maintained_open_issues() { version_sync::assert_contains_regex!( "Cargo.toml", &format!( - r#"^is-it-maintained-open-issues = \{{ repository = "{0}/{{name}}" \}}$"#, + r#"^is-it-maintained-open-issues = \{{ repository = "{0}/{{name}}" \}}"#, USER, ) ); @@ -31,13 +31,13 @@ fn maintenance() { version_sync::assert_contains_regex!( "Cargo.toml", if BRANCH == "develop" || BRANCH == "unstable" { - r#"^maintenance = \{ status = "experimental" \}$"# + r#"^maintenance = \{ status = "experimental" \}"# } else if BRANCH.starts_with('v') { // Stable branch. - r#"^maintenance = \{ status = "(actively-developed|passively-maintained)" \}$"# + r#"^maintenance = \{ status = "(actively-developed|passively-maintained)" \}"# } else { // Just check it's there. - r#"^maintenance = \{ status = ".+" \}$"# + r#"^maintenance = \{ status = ".+" \}"# } ); } diff --git a/tests/unincluded_meta_codeowners.rs b/tests/unincluded_meta_codeowners.rs new file mode 100644 index 0000000..17bcb30 --- /dev/null +++ b/tests/unincluded_meta_codeowners.rs @@ -0,0 +1,10 @@ +#![cfg(not(miri))] + +#[path = "meta_constants_.rs"] +mod constants; +use constants::*; + +#[test] +fn user_appears() { + version_sync::assert_contains_regex!("CODEOWNERS", &format!("^* @{user}$", user = USER)); +}