Skip to content

Commit

Permalink
ci: add spellcheck (codespell)
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Aug 20, 2023
1 parent 1ace29b commit 19dad92
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .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
2 changes: 1 addition & 1 deletion .reuse/dep5
Expand Up @@ -4,7 +4,7 @@ Upstream-Contact: The libssh2 team <libssh2-devel@lists.haxx.se>
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

Expand Down
3 changes: 3 additions & 0 deletions ci/spellcheck-words.txt
@@ -0,0 +1,3 @@
gord
pase
nam
12 changes: 12 additions & 0 deletions 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)
6 changes: 3 additions & 3 deletions src/os400qc3.c
Expand Up @@ -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);
Expand Down

0 comments on commit 19dad92

Please sign in to comment.