Skip to content

Commit

Permalink
fix: small typo in list cli (prefix-dev#1169)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejager authored Apr 11, 2024
1 parent 89b4a41 commit 7fdf9ef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
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,
}

/// 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

0 comments on commit 7fdf9ef

Please sign in to comment.