diff --git a/CHANGELOG.md b/CHANGELOG.md index b5e3100..4affcdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,17 @@ - -## 1.0.0 (2020-03-26) +# Change Log +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + +## [Unreleased] - ReleaseDate + +## 1.0.0 - 2020-03-26 Stable release! - -## 0.13.1 (2019-12-01) +## 0.13.1 - 2019-12-01 #### Features @@ -13,8 +20,7 @@ Stable release! - -## 0.13.0 (2019-11-29) +## 0.13.0 - 2019-11-29 #### Breaking Changes @@ -29,8 +35,7 @@ Stable release! - -## 0.11.3 (2019-01-29) +## 0.11.3 - 2019-01-29 #### Features @@ -39,8 +44,7 @@ Stable release! - -## 0.11.2 (2019-01-29) +## 0.11.2 - 2019-01-29 #### Features @@ -49,8 +53,7 @@ Stable release! - -## 0.11.1 (2019-01-29) +## 0.11.1 - 2019-01-29 #### Features @@ -59,8 +62,7 @@ Stable release! - -## 0.11.0 (2019-01-29) +## 0.11.0 - 2019-01-29 #### Breaking Changes @@ -80,8 +82,7 @@ Stable release! - -## 0.10.1 (2019-01-07) +## 0.10.1 - 2019-01-07 #### Bug Fixes @@ -90,8 +91,7 @@ Stable release! - -## 0.10.0 (2018-10-26) +## 0.10.0 - 2018-10-26 #### Breaking Changes @@ -109,8 +109,7 @@ Stable release! - -## 0.9.0 (2018-08-02) +## 0.9.0 - 2018-08-02 #### Breaking Changes @@ -137,8 +136,7 @@ Stable release! - -## 0.3.0 (2018-06-27) +## 0.3.0 - 2018-06-27 #### Features @@ -161,15 +159,13 @@ Stable release! - -## 0.2.1 (2018-06-13) +## 0.2.1 - 2018-06-13 * Documentation updates - -## 0.2.0 (2018-05-30) +## 0.2.0 - 2018-05-30 #### Bug Fixes @@ -183,8 +179,7 @@ Stable release! * Update version of `predicates-rs` to v0.5.0. - -## 0.1.1 (2018-05-28) +## 0.1.1 - 2018-05-28 #### Features @@ -192,4 +187,5 @@ Stable release! * Add a prelude ([43539abf](https://github.com/assert-rs/assert_fs/commit/43539abff3e3ee879b763f5049817ca7d8609fed)) - + +[Unreleased]: https://github.com/assert-rs/predicates-rs/compare/v1.0.0...HEAD diff --git a/Cargo.toml b/Cargo.toml index 485e2b2..41beff4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,11 @@ categories = ["development-tools::testing"] keywords = ["filesystem", "test", "assert", "fixture"] edition = "2018" +[badges] +azure-devops = { project = "assert-rs", pipeline = "assert_fs" } +codecov = { repository = "assert-rs/assert_fs" } +maintenance = { status = "passively-maintained" } + [dependencies] tempfile = "3.0" globwalk = "0.8" diff --git a/README.md b/README.md index 4fcae0c..f6916fc 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,6 @@ - Setting up files for your tests to consume - Asserting on files produced by your tests -## Install - -Add to your `Cargo.toml`: - -```toml -[dependencies] -assert_fs = "1.0.0" -``` - ## Example Here is a trivial example: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 94b089c..b1e13a7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,31 +1,178 @@ +trigger: + branches: + include: ['master'] + tags: + include: ['v*'] +pr: + branches: + include: + - master + paths: + exclude: + - "*.md" + - "docs/*" + - "LICENSE-*" schedules: - cron: "6 6 6 * *" displayName: Monthly Build branches: include: - master +variables: + minrust: 1.44.0 + codecov_token: $(CODECOV_TOKEN_SECRET) + windows_vm: vs2017-win2016 + mac_vm: macos-10.14 + linux_vm: ubuntu-16.04 -jobs: -- template: default.yml@templates - parameters: - minrust: 1.34.0 - codecov_token: $(CODECOV_TOKEN_SECRET) -- job: "Committed" - displayName: Lint History - pool: - vmImage: 'ubuntu-16.04' - steps: - - checkout: self - - template: v1/azdo-step.yml@gh-install - parameters: - git: crate-ci/committed - target: 'x86_64-unknown-linux-gnu' - to: $(Build.StagingDirectory)/tools - - script: | - echo "This project uses Conventional style, see https://www.conventionalcommits.org" - $(Build.StagingDirectory)/tools/committed HEAD~..HEAD^2 --no-merge-commit -vv - displayName: Committed - condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) +stages: +- stage: check + displayName: Compilation Check + jobs: + - job: cargo_check + displayName: cargo check + pool: + vmImage: ${{ variables.linux_vm }} + steps: + - template: install-rust.yml@templates + parameters: + rust: stable + - script: cargo check --workspace --all-targets + displayName: Default features + - script: cargo check --workspace --all-targets --no-default-features + displayName: No-default features + - script: cargo check --workspace --all-targets --all-features + displayName: All features +- stage: test + displayName: Test + jobs: + - job: test + displayName: Test + strategy: + matrix: + windows: + imageName: ${{ variables.windows_vm }} + target: 'x86_64-pc-windows-msvc' + channel: stable + mac: + imageName: ${{ variables.mac_vm }} + target: 'x86_64-apple-darwin' + channel: stable + linux: + imageName: ${{ variables.linux_vm }} + target: 'x86_64-unknown-linux-gnu' + channel: stable + # Check for upcoming platform-specific compiler breakages + windows_beta: + imageName: ${{ variables.windows_vm }} + target: 'x86_64-pc-windows-msvc' + channel: beta + mac_beta: + imageName: ${{ variables.mac_vm }} + target: 'x86_64-apple-darwin' + channel: beta + linux_beta: + imageName: ${{ variables.linux_vm }} + target: 'x86_64-unknown-linux-gnu' + channel: beta + # Check for compiler breakages + linux_nightly: + imageName: ${{ variables.linux_vm }} + target: 'x86_64-unknown-linux-gnu' + channel: nightly + continueOnError: $[ne(variables.rust, 'stable')] + pool: + vmImage: $(imageName) + steps: + - template: install-rust.yml@templates + parameters: + rust: $(channel) + targets: ["$(TARGET)"] + - script: cargo test --target $(TARGET) --workspace + displayName: cargo test + - script: cargo doc --target $(TARGET) --workspace --no-deps + displayName: cargo doc + - job: msrv + displayName: "${{ format('Minimum supported Rust version: {0}', variables.minrust) }}" + dependsOn: [] + pool: + vmImage: ${{ variables.linux_vm }} + steps: + - template: install-rust.yml@templates + parameters: + rust: ${{ variables.minrust }} + - script: cargo check --all --bins --examples --tests + displayName: cargo check +- stage: style + displayName: Style checks + dependsOn: [] + jobs: + - job: "Committed" + displayName: Linting commit history + pool: + vmImage: ${{ variables.linux_vm }} + steps: + - checkout: self + - template: v1/azdo-step.yml@gh-install + parameters: + git: crate-ci/committed + target: 'x86_64-unknown-linux-gnu' + to: $(Build.StagingDirectory)/tools + - script: | + echo "Linting commits:" + git log --graph --oneline HEAD~..HEAD^2 + echo "Against 'committed.toml':" + $(Build.StagingDirectory)/tools/committed --dump-config - + echo "" + echo "If this fails, don't sweat it. We're trying to encourage clear communication and not hinder contributions." + echo "If it is a reasonable issue and you lack time or feel uncomfortable fixing it yourself," + echo "let us know and we can mentor or fix it." + $(Build.StagingDirectory)/tools/committed HEAD~..HEAD^2 --no-merge-commit -vv + displayName: Lint commit history + condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) + - job: style + displayName: Style checking + pool: + vmImage: ${{ variables.linux_vm }} + steps: + - template: install-rust.yml@templates + parameters: + rust: stable + components: + - rustfmt + - script: cargo fmt --all -- --check + displayName: rustfmt + - job: lint + displayName: Linting + strategy: + matrix: + current: + channel: ${{ variables.minrust }} + next: + channel: stable + continueOnError: $[eq(variables.channel, 'stable')] + pool: + vmImage: ${{ variables.linux_vm }} + steps: + - template: install-rust.yml@templates + parameters: + rust: $(channel) + components: + - clippy + - script: cargo check --workspace --all-targets --all-features + displayName: Warnings + env: + RUSTFLAGS: "-D warnings" + - script: cargo clippy --workspace --all-features --all-targets -- -D warnings + displayName: clippy +- ${{ if ne('', variables.codecov_token) }}: + - stage: coverage + displayName: Code coverage + dependsOn: test + jobs: + - template: coverage.yml@templates + parameters: + token: ${{ variables.codecov_token }} resources: repositories: diff --git a/committed.toml b/committed.toml index 96d8787..08815cf 100644 --- a/committed.toml +++ b/committed.toml @@ -1 +1,3 @@ -style="Conventional" +style="conventional" +ignore_author_re="dependabot" +merge_commit = false diff --git a/release.toml b/release.toml index 9946ba5..4b584b5 100644 --- a/release.toml +++ b/release.toml @@ -3,6 +3,9 @@ no-dev-version = true tag-message = "{{tag_name}}" tag-name = "{{prefix}}v{{version}}" pre-release-replacements = [ - {file="README.md", search="assert_fs = .*", replace="assert_fs = \"{{version}}\""}, - {file="src/lib.rs", search="assert_fs = .*", replace="assert_fs = \"{{version}}\""}, + {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, + {file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1}, + {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, + {file="CHANGELOG.md", search="", replace="\n## [Unreleased] - ReleaseDate\n", exactly=1}, + {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/assert-rs/predicates-rs/compare/{{tag_name}}...HEAD", exactly=1}, ] diff --git a/src/assert.rs b/src/assert.rs index 935763b..cd4fac7 100644 --- a/src/assert.rs +++ b/src/assert.rs @@ -20,15 +20,12 @@ //! temp.close().unwrap(); //! ``` //! -//! [`PathAssert`]: trait.PathAssert.html use std::fmt; use std::path; -use predicates; use predicates::path::PredicateFileContentExt; use predicates::str::PredicateStrExt; -use predicates_core; use predicates_tree::CaseTreeExt; use crate::fixture; @@ -61,9 +58,7 @@ use crate::fixture; /// temp.close().unwrap(); /// ``` /// -/// [`TempDir`]: ../struct.TempDir.html -/// [`predicates`]: https://docs.rs/predicates -/// [`IntoPathPredicate`]: trait.IntoPathPredicate.html +/// [`TempDir`]: super::TempDir pub trait PathAssert { /// Assert the state of files within [`TempDir`]. /// @@ -96,9 +91,7 @@ pub trait PathAssert { /// temp.close().unwrap(); /// ``` /// - /// [`TempDir`]: ../struct.TempDir.html - /// [`predicates`]: https://docs.rs/predicates - /// [`IntoPathPredicate`]: trait.IntoPathPredicate.html + /// [`TempDir`]: super::TempDir fn assert(&self, pred: I) -> &Self where I: IntoPathPredicate
,
@@ -149,7 +142,7 @@ where
}
}
-/// Used by [`PathAssert`] to convert Self into the needed [`Predicate
where
P: predicates_core::Predicate (path: P) -> Self
where
P: Into