Skip to content

Commit 5face64

Browse files
authored
Merge pull request #22 from LuisFerLCC/master
Release v0.2.0
2 parents 2d864eb + 83f748f commit 5face64

File tree

20 files changed

+758
-289
lines changed

20 files changed

+758
-289
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ If you wish to contribute to the `error-stack-macros2` codebase, feel free to fo
88

99
1. Refer to the [documentation](https://docs.rs/error-stack-macros2) to make sure the error is actually a bug and not a mistake of your own or intended behavior.
1010
1. Make sure the issue hasn't already been reported or suggested.
11+
1. Before starting to make your changes, please create an issue (if there isn't one yet) in order to discuss your proposal.
1112
1. Fork and clone the repository.
1213
1. Make your changes (add or modify tests and documentation comments as necessary to cover your changes).
1314
1. Run `cargo test` (or VSCode task _Cargo: Test_) to run the tests. You can also run `cargo build` (_Cargo: Create development build_) to test the macro in a local Cargo project, or run `cargo doc` (_Cargo: Generate documentation_) to build the documentation.
1415
1. Run `cargo fmt` and `cargo clippy` (or VSCode tasks _RustFMT: Format_ and _Cargo Clippy: Lint_) and make sure there are no warnings or errors.
15-
1. Commit and push your changes.
16+
1. Commit and push your changes. **NOTE: This repository requires all commits to be [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification). Please make sure to sign all of your commits. Commits made through the GitHub web app are signed by default.**
1617
1. [Submit a pull request](https://github.com/LuisFerLCC/error-stack-macros2/compare).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Make sure to read the [contribution guidelines](https://github.com/LuisFerLCC/error-stack-macros2/blob/master/.github/CONTRIBUTING.md) before you go any further.
88
- Is there an issue related to your changes? If so, link to it here. If not, create an issue before submitting your pull request in order to discuss.
9+
- **Please make sure that all of your commits are [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification).**
910

1011
## (How) do your changes work?
1112

.github/dependabot.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
version: 2
2+
23
updates:
4+
# Production dependencies (e.g., [dependencies], [build-dependencies])
35
- package-ecosystem: "cargo"
46
directory: "/"
57
schedule:
6-
interval: "weekly"
8+
interval: daily
9+
allow:
10+
- dependency-type: "production"
11+
labels:
12+
- "📦 Dependencies"
13+
assignees:
14+
- LuisFerLCC
15+
16+
# Development dependencies (e.g., [dev-dependencies])
17+
- package-ecosystem: "cargo"
18+
directory: "impl"
19+
schedule:
20+
interval: daily
21+
allow:
22+
- dependency-type: "development"
23+
labels:
24+
- "💻 Dev Dependencies"
25+
assignees:
26+
- LuisFerLCC

.github/labels.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
- name: 💣 Breaking change
2-
description: Unintended change that breaks existing behavior
2+
description: Change that modifies existing behavior
33
color: "f79f34"
44

55
- name: 🐞 Bug
66
description: Not working as intended
77
color: "d73a4a"
88

9+
- name: ⚙️ Configuration
10+
description: Changes to configuration files
11+
color: "7057ff"
12+
13+
- name: 📦 Dependencies
14+
description: PRs that update production dependencies
15+
color: "0d7bb5"
16+
917
- name: 💻 Dev Dependencies
1018
description: PRs that update development dependencies
1119
color: "155e8c"
@@ -74,6 +82,10 @@
7482
description: Unit testing is needed
7583
color: "c23675"
7684

85+
- name: 🔄 New release
86+
description: This PR into `stable` marks a new release
87+
color: "f9c74f"
88+
7789
- name: 🍰 Nice to have
7890
description: Unplanned behavior, but useful
7991
color: "c5def5"
@@ -82,6 +94,10 @@
8294
description: Development on this issue has been suspended
8395
color: "d4c5f9"
8496

97+
- name: 🚀 Performance
98+
description: Improvements to performance
99+
color: "fbca04"
100+
85101
- name: ✅ Ready to merge
86102
description: This PR is ready to be merged
87103
color: "0ff40b"
@@ -90,10 +106,6 @@
90106
description: Preparing for a new release (version bump, release notes, etc.)
91107
color: "f9c74f"
92108

93-
- name: 🔄 New release
94-
description: This PR into `stable` marks a new release
95-
color: "f9c74f"
96-
97109
- name: 🧪 Tests
98110
description: Improvements or additions to unit tests
99111
color: "9f2d60"

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Get crate version
4040
id: get_crate_info
4141
run: |
42-
CRATE_VERSION=$(grep '^version = ' Cargo.toml | head -n 1 | cut -d '"' -f 2)
42+
CRATE_VERSION=$(grep '^version = ' impl/Cargo.toml | head -n 1 | cut -d '"' -f 2)
4343
echo "Crate error-stack-macros2"
4444
echo "Crate Version: $CRATE_VERSION"
4545
echo "crate_version=$CRATE_VERSION" >> "$GITHUB_OUTPUT"

.github/workflows/testToStable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Get crate version
4545
id: get_crate_info
4646
run: |
47-
CRATE_VERSION=$(grep '^version = ' Cargo.toml | head -n 1 | cut -d '"' -f 2)
47+
CRATE_VERSION=$(grep '^version = ' impl/Cargo.toml | head -n 1 | cut -d '"' -f 2)
4848
echo "Crate error-stack-macros2"
4949
echo "Crate Version: $CRATE_VERSION"
5050
echo "crate_version=$CRATE_VERSION" >> "$GITHUB_OUTPUT"

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RELEASE.md

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,41 @@
1-
# `error-stack-macros2` v0.1.0
1+
# `error-stack-macros2` v0.2.0
22

3-
The very first development version of `error-stack-macros2` is finally here!
3+
We have a new development version of `error-stack-macros2`!
44

5-
## Features
5+
## Fixes
66

7-
This version (0.1.0) offers a derive macro for the [`Error`](https://doc.rust-lang.org/stable/core/error/trait.Error.html) trait which encourages the best practices for defining [`error-stack`](https://crates.io/crates/error-stack) context types.
7+
This version (0.2.0) adds support for generics and external attributes to the [`impl_error_stack`](https://docs.rs/error-stack-macros2/latest/error_stack_macros2/derive.Error.html) macro.
88

9-
Here's an example. This code:
9+
This means that types like this:
1010

1111
```rust
12-
use std::{
13-
error::Error,
14-
fmt::{self, Display, Formatter},
15-
};
16-
17-
#[derive(Debug)]
18-
pub enum CreditCardError {
19-
InvalidInput(String),
20-
Other,
21-
}
22-
23-
impl Display for CreditCardError {
24-
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
25-
let msg = match self {
26-
Self::InvalidInput(_) => "credit card not found",
27-
Self::Other => "failed to retrieve credit card",
28-
};
12+
use error_stack_macros2::Error;
2913

30-
f.write_str(msg)
31-
}
14+
#[derive(Debug, Error)]
15+
#[display("failed to retrieve credit card")]
16+
enum CreditCardError<T>
17+
where
18+
T: Display
19+
{
20+
InvalidInput(T),
21+
Other
3222
}
3323

34-
impl Error for CreditCardError {}
24+
#[derive(Debug, Error)]
25+
#[display("invalid card string")]
26+
#[allow(non_camel_case_types)]
27+
struct parseCardError;
3528
```
3629

37-
...can now be reduced to this code:
30+
...can now compile properly.
3831

39-
```rust
40-
use error_stack_macros2::Error;
32+
## Performance
4133

42-
#[derive(Debug, Error)]
43-
pub enum CreditCardError {
44-
#[display("credit card not found")]
45-
InvalidInput(String),
34+
The entire source code has been refactored to eliminate unnecessary allocations, cloning, and double iterator consumptions. This should make compile times faster and reduce memory usage.
4635

47-
#[display("failed to retrieve credit card")]
48-
Other,
49-
}
50-
```
36+
## Dependencies
5137

52-
This new release also means that we will now be listening to feedback and accepting new features (macros, obviously). We are also now committed to maintaining this macro going forward and keeping our dependencies up to date.
38+
As promised, all dependencies have been updated to their latest versions, which in this case means performance improvements and bug fixes.
5339

5440
## Previous release notes
5541

SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
| Version | Supported |
66
| ------- | --------- |
7-
| 0.1.0 ||
7+
| 0.2.0 ||
8+
| < 0.2.0 ||
89

910
## Report a vulnerability
1011

impl/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "error-stack-macros2"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["LuisFerLCC"]
55
edition = "2024"
66
rust-version = "1.90.0"
@@ -31,8 +31,8 @@ panic = "warn"
3131

3232
[dependencies]
3333
proc-macro2 = "1.0.101"
34-
quote = "1.0.40"
35-
regex = "1.11.2"
34+
quote = "1.0.41"
35+
regex = "1.11.3"
3636
syn = { version = "2.0.106", features = [] }
3737

3838
[dev-dependencies]

0 commit comments

Comments
 (0)