Skip to content

Commit 103d08a

Browse files
committed
Move clippy lints from CI to Cargo.toml
1 parent 0d23be3 commit 103d08a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/code-quality.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ jobs:
109109
command: |
110110
## `cargo clippy` lint testing
111111
unset fault
112-
CLIPPY_FLAGS="-W clippy::default_trait_access -W clippy::manual_string_new -W clippy::cognitive_complexity -W clippy::implicit_clone -W clippy::range-plus-one -W clippy::redundant-clone -W clippy::match_bool"
113112
fault_type="${{ steps.vars.outputs.FAULT_TYPE }}"
114113
fault_prefix=$(echo "$fault_type" | tr '[:lower:]' '[:upper:]')
115114
# * convert any warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message>
116-
S=$(cargo clippy --all-targets --features ${{ matrix.job.features }} --tests -pcoreutils -- ${CLIPPY_FLAGS} -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::${fault_type} file=\2,line=\3,col=\4::${fault_prefix}: \`cargo clippy\`: \1 (file:'\2', line:\3)/p;" -e '}' ; fault=true ; }
115+
S=$(cargo clippy --all-targets --features ${{ matrix.job.features }} --tests -pcoreutils -- -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::${fault_type} file=\2,line=\3,col=\4::${fault_prefix}: \`cargo clippy\`: \1 (file:'\2', line:\3)/p;" -e '}' ; fault=true ; }
117116
if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi
118117
119118
style_spellcheck:

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,4 +600,11 @@ unused_qualifications = "warn"
600600
[workspace.lints.clippy]
601601
all = { level = "deny", priority = -1 }
602602
#cargo = { level = "warn", priority = -1 }
603+
cognitive_complexity = "warn"
604+
default_trait_access = "warn"
605+
implicit_clone = "warn"
606+
manual_string_new = "warn"
607+
match_bool = "warn"
608+
range-plus-one = "warn"
609+
redundant-clone = "warn"
603610
ref_option = "warn"

0 commit comments

Comments
 (0)