Skip to content

clean up config by removing legacy options#9496

Merged
fdncred merged 2 commits intonushell:mainfrom
fdncred:cleanup_legacy_config
Jun 23, 2023
Merged

clean up config by removing legacy options#9496
fdncred merged 2 commits intonushell:mainfrom
fdncred:cleanup_legacy_config

Conversation

@fdncred
Copy link
Copy Markdown
Contributor

@fdncred fdncred commented Jun 21, 2023

Description

This PR cleans up the deprecated legacy config options that were deprecated in nushell version 0.72.0. These are the config points that were in the root of the config but also duplicated in the nested structures. For instance use_ls_colors was in the root of the config and also in the ls.use_ls_colors nested structure. This was originally done to preserve backwards compatibility when nested structures were introduced in the config file.

Here's a list of the legacy config points that were removed.

  • use_ls_colors - previously replaced with ls.use_ls_colors
  • rm_always_trash - previously replaced with rm.always_trash
  • history_file_format - previously replaced with history.file_format
  • sync_history_on_enter - previously replaced with history.sync_on_enter
  • max_history_size - previously replaced with history.max_size
  • quick_completions - previously replaced with completions.quick
  • partial_completions - previously replaced with completions.partial
  • max_external_completion_results - previously replaced with completions.external.max_results
  • completion_algorithm - previously replaced with completions.algorithm
  • case_sensitive_completions - previously replaced with completions.case_sensitive
  • enable_external_completion - previously replaced with completions.external.enable
  • external_completer - previously replaced with completions.external.completer
  • table_mode - previously replaced with table.mode
  • table_index_mode - previously replaced with table.index_mode
  • table_trim - previously replaced with table.trim
  • show_clickable_links_in_ls - previously replaced with ls.clickable_links
  • cd_with_abbreviations - previously replaced with cd.abbreviations
  • filesize_metric - previously replaced with filesize.metric
  • filesize_format - previously replaced with filesize.format
  • cursor_shape_vi_insert - previously replaced with cursor_shape.vi_insert
  • cursor_shape_vi_normal - previously replaced with cursor_shape.vi_normal
  • cursor_shape_emacs - previously replaced with cursor_shape.emacs

Removes log_level from the config since it doesn't do anything any longer. We moved log-level to a nushell parameter some time ago.

Renames history_isolation to isolation in the config.nu for consistency.

Fixes a couple bugs where values weren't being set in the "// Reconstruct" sections (history_isolation, table_show_empty).

Reorganized/Moved things around a tiny bit and added a few comments.

User-Facing Changes

history.history_isolation is now history.isolation.
If anyone is still using the legacy config points, deprecated since 0.72.0 2022-11-29, their config will break.

Tests + Formatting

After Submitting

@fdncred fdncred added the notes:breaking-changes This PR implies a change affecting users and has to be noted in the release notes label Jun 21, 2023
@amtoine
Copy link
Copy Markdown
Member

amtoine commented Jun 21, 2023

this sounds a very great idea, thanks for the cleanup @fdncred 😊

Copy link
Copy Markdown
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

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

i do not even remember using these once 😱

so assuming virtualenv stops complaining, leeeeet's go 🚀

@stormasm
Copy link
Copy Markdown
Contributor

Sounds like a fine idea 😄

Copy link
Copy Markdown
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

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

+1 from me as well. And as we explicitly had this warning for using the legacy options, the blast radius of making this breaking change should be limited.

@fdncred
Copy link
Copy Markdown
Contributor Author

fdncred commented Jun 23, 2023

the blast radius of making this breaking change should be limited.

agreed. let's land this.

@fdncred fdncred merged commit cbb9f8e into nushell:main Jun 23, 2023
@fdncred fdncred deleted the cleanup_legacy_config branch June 23, 2023 11:17
fnordpig pushed a commit to fnordpig/nushell that referenced this pull request Jun 23, 2023
This PR cleans up the deprecated legacy config options that were
deprecated in nushell version 0.72.0. These are the config points that
were in the root of the config but also duplicated in the nested
structures. For instance `use_ls_colors` was in the root of the config
and also in the `ls.use_ls_colors` nested structure. This was originally
done to preserve backwards compatibility when nested structures were
introduced in the config file.

Here's a list of the legacy config points that were removed.

- `use_ls_colors` - previously replaced with `ls.use_ls_colors`
- `rm_always_trash` - previously replaced with `rm.always_trash`
- `history_file_format` - previously replaced with `history.file_format`
- `sync_history_on_enter` - previously replaced with
`history.sync_on_enter`
- `max_history_size` - previously replaced with `history.max_size`
- `quick_completions` - previously replaced with `completions.quick`
- `partial_completions` - previously replaced with `completions.partial`
- `max_external_completion_results` - previously replaced with
`completions.external.max_results`
- `completion_algorithm` - previously replaced with
`completions.algorithm`
- `case_sensitive_completions` - previously replaced with
`completions.case_sensitive`
- `enable_external_completion` - previously replaced with
`completions.external.enable`
- `external_completer` - previously replaced with
`completions.external.completer`
- `table_mode` - previously replaced with `table.mode`
- `table_index_mode` - previously replaced with `table.index_mode`
- `table_trim` - previously replaced with `table.trim`
- `show_clickable_links_in_ls` - previously replaced with
`ls.clickable_links`
- `cd_with_abbreviations` - previously replaced with `cd.abbreviations`
- `filesize_metric` - previously replaced with `filesize.metric`
- `filesize_format` - previously replaced with `filesize.format`
- `cursor_shape_vi_insert` - previously replaced with
`cursor_shape.vi_insert`
- `cursor_shape_vi_normal` - previously replaced with
`cursor_shape.vi_normal`
- `cursor_shape_emacs` - previously replaced with `cursor_shape.emacs`

Removes log_level from the config since it doesn't do anything any
longer. We moved log-level to a nushell parameter some time ago.

Renames history_isolation to isolation in the config.nu for consistency.

Fixes a couple bugs where values weren't being set in the "//
Reconstruct" sections (history_isolation, table_show_empty).

Reorganized/Moved things around a tiny bit and added a few comments.

history.histor_isolation is now history.isolation.
If anyone is still using the legacy config points, deprecated since
0.72.0 2022-11-29, their config will break.

<!--
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 -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` 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
> ```
-->

<!-- 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.
-->
fnordpig pushed a commit to fnordpig/nushell that referenced this pull request Jun 23, 2023
This PR cleans up the deprecated legacy config options that were
deprecated in nushell version 0.72.0. These are the config points that
were in the root of the config but also duplicated in the nested
structures. For instance `use_ls_colors` was in the root of the config
and also in the `ls.use_ls_colors` nested structure. This was originally
done to preserve backwards compatibility when nested structures were
introduced in the config file.

Here's a list of the legacy config points that were removed.

- `use_ls_colors` - previously replaced with `ls.use_ls_colors`
- `rm_always_trash` - previously replaced with `rm.always_trash`
- `history_file_format` - previously replaced with `history.file_format`
- `sync_history_on_enter` - previously replaced with
`history.sync_on_enter`
- `max_history_size` - previously replaced with `history.max_size`
- `quick_completions` - previously replaced with `completions.quick`
- `partial_completions` - previously replaced with `completions.partial`
- `max_external_completion_results` - previously replaced with
`completions.external.max_results`
- `completion_algorithm` - previously replaced with
`completions.algorithm`
- `case_sensitive_completions` - previously replaced with
`completions.case_sensitive`
- `enable_external_completion` - previously replaced with
`completions.external.enable`
- `external_completer` - previously replaced with
`completions.external.completer`
- `table_mode` - previously replaced with `table.mode`
- `table_index_mode` - previously replaced with `table.index_mode`
- `table_trim` - previously replaced with `table.trim`
- `show_clickable_links_in_ls` - previously replaced with
`ls.clickable_links`
- `cd_with_abbreviations` - previously replaced with `cd.abbreviations`
- `filesize_metric` - previously replaced with `filesize.metric`
- `filesize_format` - previously replaced with `filesize.format`
- `cursor_shape_vi_insert` - previously replaced with
`cursor_shape.vi_insert`
- `cursor_shape_vi_normal` - previously replaced with
`cursor_shape.vi_normal`
- `cursor_shape_emacs` - previously replaced with `cursor_shape.emacs`

Removes log_level from the config since it doesn't do anything any
longer. We moved log-level to a nushell parameter some time ago.

Renames history_isolation to isolation in the config.nu for consistency.

Fixes a couple bugs where values weren't being set in the "//
Reconstruct" sections (history_isolation, table_show_empty).

Reorganized/Moved things around a tiny bit and added a few comments.

history.histor_isolation is now history.isolation.
If anyone is still using the legacy config points, deprecated since
0.72.0 2022-11-29, their config will break.

<!--
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 -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` 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
> ```
-->

<!-- 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.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:breaking-changes This PR implies a change affecting users and has to be noted in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants