From 19dad92dac7d15889dd01b172c1f0dcb3c03c4b1 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 20 Aug 2023 08:26:55 +0000 Subject: [PATCH] ci: add spellcheck (codespell) --- .github/workflows/spellcheck.yml | 18 ++++++++++++++++++ .reuse/dep5 | 2 +- ci/spellcheck-words.txt | 3 +++ ci/spellcheck.sh | 12 ++++++++++++ src/os400qc3.c | 6 +++--- 5 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/spellcheck.yml create mode 100644 ci/spellcheck-words.txt create mode 100755 ci/spellcheck.sh diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 0000000000..3595ef4f3c --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,18 @@ +# Copyright (C) The libssh2 project and its contributors. +# +# SPDX-License-Identifier: BSD-3-Clause +# +name: "spellcheck" +on: [push, pull_request] + +permissions: {} + +jobs: + spellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: 'install tools' + run: pip3 install -U codespell + - name: 'run spellcheck' + run: ./ci/spellcheck.sh diff --git a/.reuse/dep5 b/.reuse/dep5 index a2cc768eea..f9894aac5a 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -4,7 +4,7 @@ Upstream-Contact: The libssh2 team Source: https://libssh2.org/ # Test data -Files: tests/openssh_server/* tests/ossfuzz/* tests/key_* tests/test_read_algos.txt +Files: tests/openssh_server/* tests/ossfuzz/* tests/key_* tests/test_read_algos.txt ci/spellcheck-words.txt Copyright: The libssh2 project and its contributors. License: BSD-3-Clause diff --git a/ci/spellcheck-words.txt b/ci/spellcheck-words.txt new file mode 100644 index 0000000000..2f39b28074 --- /dev/null +++ b/ci/spellcheck-words.txt @@ -0,0 +1,3 @@ +gord +pase +nam diff --git a/ci/spellcheck.sh b/ci/spellcheck.sh new file mode 100755 index 0000000000..c95e758997 --- /dev/null +++ b/ci/spellcheck.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Copyright (C) The libssh2 project and its contributors. +# SPDX-License-Identifier: BSD-3-Clause + +set -e + +cd "$(dirname "$0")/.." + +# shellcheck disable=SC2046 +codespell --skip='docs/AUTHORS' --check-hidden \ + --ignore-words='ci/spellcheck-words.txt' \ + $(git ls-files) diff --git a/src/os400qc3.c b/src/os400qc3.c index af12f0839b..1dca259462 100644 --- a/src/os400qc3.c +++ b/src/os400qc3.c @@ -635,11 +635,11 @@ static asn1Element * asn1_new_from_bytes(const unsigned char *data, unsigned int length) { asn1Element *e; - asn1Element te; + asn1Element et; - getASN1Element(&te, + getASN1Element(&et, (unsigned char *) data, (unsigned char *) data + length); - e = asn1_new(te.tag, te.end - te.beg); + e = asn1_new(et.tag, et.end - et.beg); if(e) memcpy(e->header, data, e->end - e->header);