rust/tests/ui-toml
bors b6ad6fc5aa Auto merge of #8823 - smoelius:unknown-field, r=xFrednet
Improve "unknown field" error messages

Fixes #8806

Sample output:
```
error: error reading Clippy's configuration file `/home/smoelius/github/smoelius/rust-clippy/clippy.toml`: unknown field `foobar`, expected one of
           allow-expect-in-tests              enable-raw-pointer-heuristic-for-send    standard-macro-braces
           allow-unwrap-in-tests              enforced-import-renames                  third-party
           allowed-scripts                    enum-variant-name-threshold              too-large-for-stack
           array-size-threshold               enum-variant-size-threshold              too-many-arguments-threshold
           avoid-breaking-exported-api        literal-representation-threshold         too-many-lines-threshold
           await-holding-invalid-types        max-fn-params-bools                      trivial-copy-size-limit
           blacklisted-names                  max-include-file-size                    type-complexity-threshold
           cargo-ignore-publish               max-struct-bools                         unreadable-literal-lint-fractions
           cognitive-complexity-threshold     max-suggested-slice-pattern-length       upper-case-acronyms-aggressive
           cyclomatic-complexity-threshold    max-trait-bounds                         vec-box-size-threshold
           disallowed-methods                 msrv                                     verbose-bit-mask-threshold
           disallowed-types                   pass-by-value-size-limit                 warn-on-all-wildcard-imports
           doc-valid-idents                   single-char-binding-names-threshold
       at line 1 column 1
```

You can test this by (say) adding `foobar = 42` to Clippy's root `clippy.toml` file, and running `cargo run --bin cargo-clippy`.

Note that, to get the terminal width, this PR adds `termize` as a dependency to `cargo-clippy`. However, `termize` is also [how `rustc_errors` gets the terminal width](481db40311/compiler/rustc_errors/src/emitter.rs (L1607)). So, hopefully, this is not a dealbreaker.

r? `@xFrednet`

changelog: Enhancements: the "unknown field" error messages for config files now wraps the field names.
2022-05-18 17:15:38 +00:00
..
await_holding_invalid_type fixup! Add await_holding_invalid_type lint 2022-04-18 11:16:35 -07:00
bad_toml
bad_toml_type
conf_deprecated_key
expect_used Optionally allow expect and unwrap in tests 2022-05-08 07:18:31 -04:00
fn_params_excessive_bools
functions_maxlines Move let_unit_value back into style 2022-04-14 21:33:32 -04:00
good_toml_no_false_negatives
invalid_min_rust_version
large_include_file Add large_include_file lint 2022-04-24 10:08:31 -04:00
lint_decimal_readability
max_suggested_slice_pattern_length New index_refutable_slice lint 2021-11-11 17:34:02 +01:00
min_rust_version adding condition for map_clone message 2022-04-12 04:03:48 +09:00
missing_enforced_import_rename
nonstandard_macro_braces
strict_non_send_fields_in_send_ty Fix grammar issues 2021-12-07 10:08:22 -05:00
struct_excessive_bools fix existing clippy tests 2022-03-30 20:12:58 +02:00
toml_blacklist
toml_disallowed_methods Use method name from conf::DisallowedMethod 2022-01-12 16:23:22 +00:00
toml_disallowed_types Pluralize disallowed_type lint filenames 2021-11-18 17:37:06 +01:00
toml_trivially_copy
toml_unknown_key Improve "unknown field" error messages 2022-05-18 05:21:10 -04:00
unwrap_used Use the traits added to the Rust 2021 Edition prelude 2022-05-12 00:38:11 +09:00
upper_case_acronyms_aggressive
vec_box_sized
zero_single_char_names
update-all-references.sh