Skip to content

deprecate size to str size#10772

Merged
sholderbach merged 3 commits intonushell:mainfrom
amtoine:deprecate-size-to-str-size
Oct 20, 2023
Merged

deprecate size to str size#10772
sholderbach merged 3 commits intonushell:mainfrom
amtoine:deprecate-size-to-str-size

Conversation

@amtoine
Copy link
Copy Markdown
Member

@amtoine amtoine commented Oct 19, 2023

related to

Description

it appears size is a command that operates on strings only and gives the user information about the chars, graphemes and bytes of a string.
this looks like a command that should be a subcommand to str 😏

this PR

  • adds str size
  • deprecates size

size is planned to be removed in 0.88

User-Facing Changes

str size can be used for the same result as size.

Tests + Formatting

After Submitting

write a removal PR for size

@amtoine amtoine added the category:deprecation Related to the deprecation of commands/features/options label Oct 19, 2023
@amtoine
Copy link
Copy Markdown
Member Author

amtoine commented Oct 19, 2023

cc/ @fdncred

Copy link
Copy Markdown
Contributor

@fdncred fdncred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems appropriate.

This has nothing to do with your work here but it's still an odd command. Maybe it's supposed to be nushell's version of wc?

 wc Cargo.toml 
 176  759 6094 Cargo.toml
 open Cargo.toml -r | size
╭─────────┬────╮
│lines    │176 
│words    │743 
│bytes    │6094│
│chars    │6094│
│graphemes│5918│
╰─────────┴────╯

@sholderbach sholderbach merged commit 6a25395 into nushell:main Oct 20, 2023
sholderbach added a commit to sholderbach/nu_scripts that referenced this pull request Oct 20, 2023
Deprecation will be released with `0.87`
- nushell/nushell#10772
Final removal in `0.88`
gaetschwartz pushed a commit to gaetschwartz/nushell that referenced this pull request Oct 20, 2023
related to
-
https://discord.com/channels/601130461678272522/614613939334152217/1164530991931605062

# Description
it appears `size` is a command that operates on `string`s only and gives
the user information about the chars, graphemes and bytes of a string.
this looks like a command that should be a subcommand to `str` 😏 

this PR
- adds `str size`
- deprecates `size`

`size` is planned to be removed in 0.88

# User-Facing Changes
`str size` can be used for the same result as `size`.

# Tests + Formatting

# After Submitting
write a removal PR for `size`
@amtoine amtoine deleted the deprecate-size-to-str-size branch October 20, 2023 13:50
@amtoine
Copy link
Copy Markdown
Member Author

amtoine commented Oct 20, 2023

@fdncred
yeah sounds like some kind of Nushell version to wc 🤔

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Oct 20, 2023

I was wondering if str info might be better? It just seems like str size will be confused with str length.

@amtoine
Copy link
Copy Markdown
Member Author

amtoine commented Oct 20, 2023

I was wondering if str info might be better? It just seems like str size will be confused with str length.

it's the size in memory i'd say? 🤔

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Oct 20, 2023

I'm not sure "size in memory" is correct either. Not really sure what the correct name is.

❯ "👨‍👨‍👧‍👦" | str size
╭───────────┬────╮
│ lines     │ 1  │
│ words     │ 0  │
│ bytes     │ 25 │
│ chars     │ 7  │
│ graphemes │ 1  │
╰───────────┴────╯

@hustcer
Copy link
Copy Markdown
Contributor

hustcer commented Oct 20, 2023

str stats

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Oct 20, 2023

ya, i could support str stats.

@amtoine
Copy link
Copy Markdown
Member Author

amtoine commented Oct 21, 2023

feel free to overwrite this PR with a new name, we're inbetween two releases, so that's more than fine 😉
just remember that #10784 will have to be replaced as well 😋

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Oct 21, 2023

@hustcer Do you feel like updating the name and #10784? If not, I can try to remember to do it.

@hustcer
Copy link
Copy Markdown
Contributor

hustcer commented Oct 21, 2023

@hustcer Do you feel like updating the name and #10784? If not, I can try to remember to do it.

OKay, I will update it later

@hustcer hustcer removed the category:deprecation Related to the deprecation of commands/features/options label Oct 21, 2023
fdncred pushed a commit that referenced this pull request Oct 21, 2023
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

Rename `str size` to `str stats`, for more detail see:
#10772

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
sholderbach added a commit to nushell/nu_scripts that referenced this pull request Dec 6, 2023
Deprecation will be released with `0.87`
- ~~nushell/nushell#10772
- nushell/nushell#10798

Final removal in `0.88`


Land before: 
- nushell/nushell#10784
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
related to
-
https://discord.com/channels/601130461678272522/614613939334152217/1164530991931605062

# Description
it appears `size` is a command that operates on `string`s only and gives
the user information about the chars, graphemes and bytes of a string.
this looks like a command that should be a subcommand to `str` 😏 

this PR
- adds `str size`
- deprecates `size`

`size` is planned to be removed in 0.88

# User-Facing Changes
`str size` can be used for the same result as `size`.

# Tests + Formatting

# After Submitting
write a removal PR for `size`
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->

Rename `str size` to `str stats`, for more detail see:
nushell#10772

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
maxim-uvarov pushed a commit to maxim-uvarov/nu_scripts_reduced_size that referenced this pull request Oct 12, 2024
Deprecation will be released with `0.87`
- ~~nushell/nushell#10772
- nushell/nushell#10798

Final removal in `0.88`


Land before: 
- nushell/nushell#10784
maxim-uvarov pushed a commit to maxim-uvarov/nu_scripts_reduced_size that referenced this pull request Oct 13, 2024
Deprecation will be released with `0.87`
- ~~nushell/nushell#10772
- nushell/nushell#10798

Final removal in `0.88`


Land before: 
- nushell/nushell#10784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants