Skip to content

Commit 4547cdf

Browse files
committed
Fix various linting failures
1 parent d3a573d commit 4547cdf

File tree

9 files changed

+6187
-7898
lines changed

9 files changed

+6187
-7898
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[workspace]
22
members = [ "generator", "integration", "macros" ]
33
exclude = [ "test-project" ]
4+
resolver = "2"
45

56
[workspace.metadata.release]
67
allow-branch = ["master"]

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
doc-valid-idents = ["TailwindCSS", ".."]

generator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ Here's a quick start recipe:
109109
...matches.map((m) => {
110110
let pieces = m.slice(1, m.length);
111111
return pieces.map((p) => rs_to_tw(p)).join(":");
112-
})
112+
}),
113113
);
114114
}
115115
classes.push(
116116
...[...content.matchAll(class_re)].map((m) => {
117117
return rs_to_tw(m[1]);
118-
})
118+
}),
119119
);
120120

121121
return classes;

generator/src/main.rs

Lines changed: 6153 additions & 7886 deletions
Large diffs are not rendered by default.

integration/tests/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ fn regen() -> Result<()> {
5656

5757
let run = run_command(&["cargo", "run"], &test_project_dir)?;
5858

59-
let expect = r#"
59+
let expect = r"
6060
bg-rose-500
6161
hover
6262
hover:bg-blue-50 text-white
63-
"#;
63+
";
6464
assert_eq!(str::from_utf8(&run.stdout)?.trim(), expect.trim());
6565

6666
let css = read_to_string("../test-project/assets/tailwind_compiled.css")?;

macros/examples/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
mod css;
22

3-
use css::*;
3+
use css::{ToOptionVecString, C, M};
44

55
fn main() {
66
println!("{}", C![C::typ::text_white, M![M::lg, C::typ::text_lg]]);

macros/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ macro_rules! C {
4747
// ].into_iter().filter_map(Option::is_some).flatten().join(" ")
4848
let mut all_classes = vec![];
4949
$(
50+
#[allow(clippy::used_underscore_items)]
5051
$crate::_push_all_strings(&mut all_classes, $class.to_option_vec_string());
5152
)*
5253
all_classes.join(" ")
@@ -75,6 +76,7 @@ macro_rules! DC {
7576
{
7677
let mut all_classes = vec![];
7778
$(
79+
#[allow(clippy::used_underscore_items)]
7880
$crate::_push_all_strings(&mut all_classes, $class.to_option_vec_string());
7981
)*
8082
format_args!("{}", all_classes.join(" "))
@@ -100,6 +102,7 @@ macro_rules! M {
100102
{
101103
let mut all_modifiers = vec![];
102104
$(
105+
#[allow(clippy::used_underscore_items)]
103106
$crate::_push_all_strings(&mut all_modifiers, $modifier.to_option_vec_string());
104107
)*
105108
all_modifiers.join(":")
@@ -218,6 +221,7 @@ mod tests {
218221

219222
#[test]
220223
fn to_option_vec_string_ref_option_some() {
224+
#[allow(clippy::ref_option_ref)]
221225
let option: &Option<&str> = &Some("foo_opt");
222226
assert_eq!(C![option], "foo_opt");
223227
assert_eq!(M![option], "foo_opt");

precious.toml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,30 @@ ok_exit_codes = 0
1111
lint_failure_exit_codes = 1
1212

1313
[commands.clippy]
14-
type = "lint"
15-
include = "**/*.rs"
16-
run_mode = "root"
17-
chdir = true
18-
cmd = [ "cargo", "clippy", "--locked", "--all-targets", "--all-features", "--", "-D", "clippy::all" ]
14+
type = "both"
15+
include = "**/*.rs"
16+
invoke = "once"
17+
path-args = "none"
18+
working-dir = "root"
19+
cmd = [
20+
"cargo",
21+
"clippy",
22+
"--color",
23+
"always",
24+
"--locked",
25+
"--all-targets",
26+
"--all-features",
27+
"--",
28+
"-D",
29+
"clippy::pedantic",
30+
"-D",
31+
"warnings",
32+
]
33+
tidy_flags = "--fix"
1934
ok_exit_codes = 0
2035
lint_failure_exit_codes = 101
2136
expect_stderr = true
37+
labels = ["default"]
2238

2339
[commands.prettier]
2440
type = "both"

test-project/tailwind.config.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)