rust-clippy/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 Update ui-toml tests 2019-08-14 09:58:00 +02:00
bad_toml_type Merge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyup 2021-05-06 12:20:44 +02:00
conf_deprecated_key Merge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyup 2021-05-06 12:20:44 +02:00
expect_used Optionally allow expect and unwrap in tests 2022-05-08 07:18:31 -04:00
fn_params_excessive_bools add excessive bools lints 2020-02-05 20:54:58 +03:00
functions_maxlines Move let_unit_value back into style 2022-04-14 21:33:32 -04:00
good_toml_no_false_negatives Renamed: Cyclomatic Complexity -> Cognitive Complexity 2019-03-06 10:07:38 -03:00
invalid_min_rust_version Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyup 2020-12-06 15:01:03 +01:00
large_include_file Add large_include_file lint 2022-04-24 10:08:31 -04:00
lint_decimal_readability Don't abort compilation after giving a lint error 2021-11-08 01:22:28 +00:00
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 Merge commit '61eb38aeda6cb54b93b872bf503d70084c4d621c' into clippyup 2021-07-01 18:17:38 +02:00
nonstandard_macro_braces Fix clippy with changed macro statement spans 2021-10-15 02:36:58 -05:00
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 Remove all copyright license headers 2019-01-08 21:46:39 +01:00
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 Merge commit 'cb7915b00c235e9b5861564f3be78dba330980ee' into clippyup 2021-09-28 18:03:12 +01:00
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 Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyup 2021-04-08 17:50:13 +02:00
vec_box_sized Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup 2021-03-12 15:30:50 +01:00
zero_single_char_names Add test for zero single char names 2020-04-15 13:35:44 +02:00
update-all-references.sh Merge commit '4911ab124c481430672a3833b37075e6435ec34d' into clippyup 2020-12-20 17:19:49 +01:00