Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pulldown-cmark = { version = "0.11", default-features = false, features = ["html
askama = { version = "0.15.4", default-features = false, features = ["alloc", "config", "derive"] }

[dev-dependencies.toml]
version = "0.9.7"
version = "1.1"
default-features = false
# preserve_order keeps diagnostic output in file order
features = ["parse", "preserve_order"]
Expand Down
2 changes: 1 addition & 1 deletion clippy_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false
clippy_utils = { path = "../clippy_utils" }
itertools = "0.12"
serde = { version = "1.0", features = ["derive"] }
toml = "0.7.3"
toml = "1.1"

[dev-dependencies]
walkdir = "2.3"
Expand Down
4 changes: 3 additions & 1 deletion clippy_config/src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,9 @@ pub fn lookup_conf_file() -> io::Result<(Option<PathBuf>, Vec<String>)> {
}

fn deserialize(file: &SourceFile) -> TryConf {
match toml::de::Deserializer::new(file.src.as_ref().unwrap()).deserialize_map(ConfVisitor(file)) {
match toml::de::Deserializer::parse(file.src.as_ref().unwrap())
.and_then(|deserializer| deserializer.deserialize_map(ConfVisitor(file)))
{
Ok(mut conf) => {
extend_vec_if_indicator_present(&mut conf.conf.disallowed_names, DEFAULT_DISALLOWED_NAMES);
extend_vec_if_indicator_present(&mut conf.conf.allowed_prefixes, DEFAULT_ALLOWED_PREFIXES);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ semver = "1.0"
url = "2.2"

[dependencies.toml]
version = "0.9.7"
version = "1.1"
default-features = false
# preserve_order keeps diagnostic output in file order
features = ["parse", "preserve_order"]
Expand Down
2 changes: 1 addition & 1 deletion lintcheck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.85"
strip-ansi-escapes = "0.2.0"
tar = "0.4.45"
toml = "0.9.7"
toml = "1.1"
ureq = { version = "2.2", features = ["json"] }
walkdir = "2.3"
2 changes: 1 addition & 1 deletion tests/ui-toml/bad_toml/conf_bad_toml.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@error-in-other-file: error reading Clippy's configuration file: expected `.`, `=`
//@error-in-other-file: error reading Clippy's configuration file: key with no value, expected `=`

fn main() {}
2 changes: 1 addition & 1 deletion tests/ui-toml/bad_toml/conf_bad_toml.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: error reading Clippy's configuration file: expected `.`, `=`
error: error reading Clippy's configuration file: key with no value, expected `=`
--> $DIR/tests/ui-toml/bad_toml/clippy.toml:1:4
|
LL | fn this_is_obviously(not: a, toml: file) {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-toml/duplicated_keys/duplicated_keys.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@error-in-other-file: duplicate key `cognitive-complexity-threshold`
//@error-in-other-file: duplicate key

fn main() {}
4 changes: 2 additions & 2 deletions tests/ui-toml/duplicated_keys/duplicated_keys.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: error reading Clippy's configuration file: duplicate key `cognitive-complexity-threshold` in document root
error: error reading Clippy's configuration file: duplicate key
--> $DIR/tests/ui-toml/duplicated_keys/clippy.toml:2:1
|
LL | cognitive-complexity-threshold = 4
| ^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

20 changes: 8 additions & 12 deletions tests/ui-toml/toml_invalid_path/conf_invalid_path.stderr
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
warning: expected a macro, found a primitive type
--> $DIR/tests/ui-toml/toml_invalid_path/clippy.toml:1:1
|
LL | / [[disallowed-macros]]
LL | | path = "bool"
| |_____________^
LL | [[disallowed-macros]]
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: add `allow-invalid = true` to the entry to suppress this warning

warning: `std::process::current_exe` does not refer to a reachable function
--> $DIR/tests/ui-toml/toml_invalid_path/clippy.toml:4:1
|
LL | / [[disallowed-methods]]
LL | | path = "std::process::current_exe"
| |__________________________________^
LL | [[disallowed-methods]]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `allow-invalid = true` to the entry to suppress this warning

warning: `` does not refer to a reachable function
--> $DIR/tests/ui-toml/toml_invalid_path/clippy.toml:7:1
|
LL | / [[disallowed-methods]]
LL | | path = ""
| |_________^
LL | [[disallowed-methods]]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `allow-invalid = true` to the entry to suppress this warning

warning: expected a type, found a variant
--> $DIR/tests/ui-toml/toml_invalid_path/clippy.toml:10:1
|
LL | / [[disallowed-types]]
LL | | path = "std::result::Result::Err"
| |_________________________________^
LL | [[disallowed-types]]
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add `allow-invalid = true` to the entry to suppress this warning

Expand Down
10 changes: 4 additions & 6 deletions tests/ui-toml/toml_unloaded_crate/conf_unloaded_crate.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
warning: `regex::Regex::new_` does not refer to a reachable function
--> $DIR/tests/ui-toml/toml_unloaded_crate/clippy.toml:3:1
|
LL | / [[disallowed-methods]]
LL | | path = "regex::Regex::new_"
| |___________________________^
LL | [[disallowed-methods]]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `allow-invalid = true` to the entry to suppress this warning

warning: `regex::Regex_::new` does not refer to a reachable function
--> $DIR/tests/ui-toml/toml_unloaded_crate/clippy.toml:6:1
|
LL | / [[disallowed-methods]]
LL | | path = "regex::Regex_::new"
| |___________________________^
LL | [[disallowed-methods]]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `allow-invalid = true` to the entry to suppress this warning

Expand Down
Loading