From 8bb2826f7a396cdc49542bf3bb868a9c61848ed2 Mon Sep 17 00:00:00 2001 From: georg <georg@riseup.net> Date: Mon, 22 Jul 2019 13:31:40 -0700 Subject: [PATCH] CI: Add job to run codespell, a spell checking software --- .gitlab-ci.yml | 9 +++++++++ libmat2/parser_factory.py | 2 +- utils/ci/codespell/ignored_words.txt | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 utils/ci/codespell/ignored_words.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06ab608..4d1f844 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,15 @@ linting:bandit: - bandit -r ./nautilus/ --format txt --skip B101 - bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314 +linting:codespell: + image: $CONTAINER_REGISTRY:linting + stage: linting + script: + # Run codespell to check for spelling errors; ignore errors about binary + # files, use a config with ignored words and exclude the git directory, + # which might contain false positives + - codespell -q 2 -I utils/ci/codespell/ignored_words.txt -S .git + linting:pylint: image: $CONTAINER_REGISTRY:linting stage: linting diff --git a/libmat2/parser_factory.py b/libmat2/parser_factory.py index 6150b26..23529db 100644 --- a/libmat2/parser_factory.py +++ b/libmat2/parser_factory.py @@ -56,7 +56,7 @@ def get_parser(filename: str) -> Tuple[Optional[T], Optional[str]]: try: return parser_class(filename), mtype except ValueError as e: - logging.info("Got an exception when trying to instanciate " + logging.info("Got an exception when trying to instantiate " "%s for %s: %s", parser_class, filename, e) return None, mtype return None, mtype diff --git a/utils/ci/codespell/ignored_words.txt b/utils/ci/codespell/ignored_words.txt new file mode 100644 index 0000000..02ae70c --- /dev/null +++ b/utils/ci/codespell/ignored_words.txt @@ -0,0 +1,3 @@ +# Words to be ignored by codespell. +# Put one word per line and sort alphabetically. +process' -- GitLab