From 4a1acae5bc2b5acf72671484903a452264fa8354 Mon Sep 17 00:00:00 2001 From: Jay Faulkner Date: Thu, 28 Dec 2023 10:41:30 -0800 Subject: [PATCH] Add tox target and configuration for codespell Adds a tox target for codespell, `tox -e codespell`. Can optionally be run as `tox -e codespell -- -w` to get automatic spelling fixes applied where appropriate. Adds small amounts of configuration to setup.cfg, including an ignore list of words. Related-bug: #2047654 Change-Id: I98203b02a9c6b6fc36edd6b4bbcc7c92a634da8b --- setup.cfg | 6 ++++++ tox.ini | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/setup.cfg b/setup.cfg index e5bed2d4d..6e570d7c1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -71,3 +71,9 @@ tag_svn_revision = 0 [extras] burnin-network-kazoo = kazoo>=2.8.0 # Apache-2.0 + +[codespell] +quiet-level = 4 +# Words to ignore: +# cna: Intel CNA card +ignore-words-list = cna diff --git a/tox.ini b/tox.ini index 53bf77ebc..66f518dd8 100644 --- a/tox.ini +++ b/tox.ini @@ -24,6 +24,15 @@ passenv = no_proxy NO_PROXY +[testenv:codespell] +description = + Run codespell to check spelling +deps = codespell +# note(JayF): {posargs} lets us run `tox -ecodespell -- -w` to get codespell +# to correct spelling issues in our code it's aware of. +commands = + codespell {posargs} + [testenv:functional] # Define virtualenv directory, port to use for functional testing, and number # of seconds to wait for the agent to come alive during functional testing.