Skip to content

better error message if plugin name doesn't starts with nu_plugin_#8562

Merged
fdncred merged 2 commits intonushell:mainfrom
WindSoilder:friendly_msg_when_register
Mar 22, 2023
Merged

better error message if plugin name doesn't starts with nu_plugin_#8562
fdncred merged 2 commits intonushell:mainfrom
WindSoilder:friendly_msg_when_register

Conversation

@WindSoilder
Copy link
Copy Markdown
Contributor

Description

Fixes: #8548

User-Facing Changes

❯ register target/debug/formats
Error:
  × Register plugin failed
   ╭─[entry #1:1:1]
 1 │ register target/debug/formats
   ·          ──────────┬─────────
   ·                    ╰── plugin name must starts with nu_plugin_
   ╰────

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 -A clippy::needless_collect to check that you're using the standard code style
  • cargo test --workspace to check that all tests pass

Note
from nushell you can also use the toolkit as follows

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 after the PR is merged, if necessary. This will help us keep the docs up to date.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2023

Codecov Report

Merging #8562 (f980ba7) into main (93e5d8e) will increase coverage by 0.40%.
The diff coverage is 89.26%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8562      +/-   ##
==========================================
+ Coverage   68.13%   68.53%   +0.40%     
==========================================
  Files         624      624              
  Lines      100512   100625     +113     
==========================================
+ Hits        68481    68961     +480     
+ Misses      32031    31664     -367     
Impacted Files Coverage Δ
crates/nu-parser/src/parse_keywords.rs 68.34% <23.52%> (-0.18%) ⬇️
crates/nu-command/src/formats/to/nuon.rs 88.32% <97.70%> (+5.08%) ⬆️
crates/nu-command/src/filters/uniq.rs 98.22% <100.00%> (ø)

... and 5 files with indirect coverage changes

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Mar 22, 2023

much better error message. thanks!

@fdncred fdncred merged commit cd6f860 into nushell:main Mar 22, 2023
@WindSoilder WindSoilder deleted the friendly_msg_when_register branch August 2, 2023 22:05
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.

Better error reporting when registering a plugin not named nu_plugin_xxx

3 participants