Skip to content

Commit 253fb22

Browse files
Merge branch 'master' into yew-link
2 parents d4f595e + 40e7134 commit 253fb22

7 files changed

Lines changed: 436 additions & 101 deletions

File tree

.github/workflows/clippy.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
profile:
2626
- dev
2727
- release
28+
target:
29+
- host
30+
- wasm32
2831
steps:
2932
- uses: actions/checkout@v6
3033

@@ -33,6 +36,7 @@ jobs:
3336
with:
3437
toolchain: stable
3538
components: clippy
39+
targets: ${{ case(matrix.target == 'wasm32', 'wasm32-unknown-unknown', null) }}
3640

3741
- uses: Swatinem/rust-cache@v2
3842
with:
@@ -41,21 +45,16 @@ jobs:
4145
- uses: taiki-e/install-action@cargo-hack
4246

4347
- name: Lint feature soundness
44-
if: matrix.profile == 'dev'
48+
env:
49+
RELEASE_FLAG: ${{ case(matrix.profile == 'release', '--release', null) }}
50+
TARGET_FLAGS: ${{ case(matrix.target == 'wasm32', '--target wasm32-unknown-unknown', null) }}
4551
run: >-
4652
cargo hack clippy
4753
-p yew -p yew-agent -p yew-router -p yew-link
4854
--feature-powerset --no-dev-deps
4955
--keep-going
50-
-- -D warnings
51-
52-
- name: Lint feature soundness
53-
if: matrix.profile == 'release'
54-
run: >-
55-
cargo hack clippy
56-
-p yew -p yew-agent -p yew-router -p yew-link
57-
--feature-powerset --no-dev-deps
58-
--keep-going --release
56+
$RELEASE_FLAG
57+
$TARGET_FLAGS
5958
-- -D warnings
6059
6160
clippy:

packages/yew-macro/src/html_tree/lint/mod.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,27 @@ impl Lint for AHrefLint {
7070
if let syn::Lit::Str(href) = &lit.lit {
7171
let href_value = href.value();
7272
match href_value.as_ref() {
73-
"#" | "javascript:void(0)" => emit_warning!(
74-
lit.span(),
75-
format!("'{href_value}' is not a suitable value for the `href` attribute. \
73+
"#" | "javascript:void(0)" => emit_warning!(
74+
lit.span(),
75+
format!(
76+
"'{href_value}' is not a suitable value for the `href` attribute. \
7677
Without a meaningful attribute assistive technologies \
7778
will struggle to understand your webpage. \
7879
https://developer.mozilla.org/en-US/docs/Learn/Accessibility/HTML#onclick_events"
79-
)),
80-
_ => {}
81-
82-
}
80+
)
81+
),
82+
_ => {}
83+
}
8384
}
8485
};
8586
}
8687
_ => {
8788
emit_warning!(
88-
quote::quote! {#tag_name}.span(),
89-
"All `<a>` elements should have a `href` attribute. This makes it possible \
89+
quote::quote! {#tag_name}.span(),
90+
"All `<a>` elements should have a `href` attribute. This makes it possible \
9091
for assistive technologies to correctly interpret what your links point to. \
9192
https://developer.mozilla.org/en-US/docs/Learn/Accessibility/HTML#more_on_links"
92-
)
93+
)
9394
}
9495
}
9596
}

0 commit comments

Comments
 (0)