Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: small typo in list cli #1169

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,20 @@ To sync the colors of the different parts of the ui, we use the following rules:
- `style("task").blue()`: The task name

These styles are put in the `consts` module or are a `.fancy_display()` on the names. If you want to add a new generic color, please add it there.


## Comment for Breaking Change
If you have a work-around for a potential breaking change, please add a comment in the code where you think the breaking change will happen. And what needs to be done when we **actually** want to break it. Use `BREAK:` in the comment to denote this.

For example:
```rust
// an enum to sort by size or name
#[derive(clap::ValueEnum, Clone, Debug, Serialize)]
pub enum SortBy {
Size,
Name,
// BREAK: remove the alias
#[value(alias = "type")]
Kind,
}
```
6 changes: 4 additions & 2 deletions src/cli/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ use crate::Project;
pub enum SortBy {
Size,
Name,
Type,
// BREAK: remove the alias
#[value(alias = "type")]
Kind,
ruben-arts marked this conversation as resolved.
Show resolved Hide resolved
}

/// List project's packages. Highlighted packages are explicit dependencies.
Expand Down Expand Up @@ -187,7 +189,7 @@ pub async fn execute(args: Args) -> miette::Result<()> {
SortBy::Name => {
packages_to_output.sort_by(|a, b| a.name.cmp(&b.name));
}
SortBy::Type => {
SortBy::Kind => {
packages_to_output.sort_by(|a, b| a.kind.cmp(&b.kind));
}
}
Expand Down
Loading