From e5288a16c7fc58095e3f4a659761c4f03b8170ef Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Fri, 15 Nov 2024 12:00:00 +0100 Subject: [PATCH] `.pre-commit-config.yaml`: Add the CSpell spell checker Signed-off-by: Bernhard Kaindl --- .gitignore | 5 +- .pre-commit-config.yaml | 7 ++ .vscode/ltex.dictionary.en-US.txt | 194 +++++++++++++++++++++++++++++- cspell.json | 48 ++++++++ 4 files changed, 251 insertions(+), 3 deletions(-) create mode 100644 cspell.json diff --git a/.gitignore b/.gitignore index 4ef9fdd1..ba6694d1 100644 --- a/.gitignore +++ b/.gitignore @@ -28,13 +28,14 @@ __pycache__/ # private vscode workspace settings: .vscode/settings.json +# Virtualenv +.venv/ + # temporary file from tests/test_cpio.py (to be fixed later) /data # Output from mypy --txt-report /index.txt -htmlcov/ - # Pip editable install directory python_libs.egg-info/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a3bce6a7..7011e537 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -164,3 +164,10 @@ repos: - id: mixed-line-ending args: ['--fix=lf'] description: Replace line endings with LF + + +# Run the CSpell command line spell checker +- repo: https://github.com/streetsidesoftware/cspell-cli + rev: v8.16.0 + hooks: + - id: cspell diff --git a/.vscode/ltex.dictionary.en-US.txt b/.vscode/ltex.dictionary.en-US.txt index f92c872c..4420060e 100644 --- a/.vscode/ltex.dictionary.en-US.txt +++ b/.vscode/ltex.dictionary.en-US.txt @@ -1,25 +1,217 @@ -codecov +abstractmethod +accessorclass +actrc +addopts +answerfile +authhandler +autolinks +autouse +binstr +biosdevname +booleaness +bootdir +builtins +caplog +CLOEXEC +cmdline +CodeCov +configparser covcombine +covcp +coveragerc coverallsapp cpio cpiofile cpioinfo +crashkernel +curstate +datamodel +deadsnakes +dinfo +diskutil +distutils +DOTQUAD +drule +dunder +editenv +eliloader +ENOENT +ENVLOGDIR +errkey +errmsg +eths euxv +extlinux +EXTLINUX +faulthandler +fcoe +filehandle +Filesyste +FilesystemAccessor +filterwarnings +fstype +ftpaccessor +ftpserver +getpid +getpreferredencoding +getuid +grubdir +grubenv +hardlinks +host-cpu-tune +hpet +httpaccessor +httpserver +hwdata ibft +icdiff ifrename +igmp +inputtext +intify +isort +keywrd kname +koji +kwargs lastboot +laststate +levelname +lfile +libc +libexec linkname +linktext +localftpserver logbuf +ltex +lzma MACPCI +markdownlint +mboot +mdreport +Mellanox +memoryhelper +menuentry +minidom +mountingaccessor +mountpoint +multiboot +mypy +Navi nektos +netdev +netns +newc +newdefault +newhw +NEWNET +nfspath +nics +nodelist +nodocker +nolvm +noqueue +norules +oldstate +ord organisation +outerr +outkey +passman +pathexists +pciids +pcis +pcpus +pipx +Popen +ppns +precheck +proc +pvsproxy +pycache +pyenv pyfakefs +pylance +pyliblzma +pylint +Pylint +pylintrc +pylzma pyproject +pyright +pytest +PYTHONDEVMODE +pythonpath PYTHONWARNINGS +pytype +qdisc +qlen +Radeon +rckey +readbuffer +readline +repofiles +REPOMD +retcode +retrans rulefile +sbdf +SBDF +sbdfi +setdefault +setenv +SETFD +setuptools +shellcheck +signoff +somestring +sourcery +srule +strerror +stringio +subcls +subdevice +subvendor +sysconfig +tboot +Tboot +templatedir +testfile +testpaths +textiowrapper +timeo +tmpfs +tmultiboot tname tokenless +Traceback +treeinfo +ucode +ucontext +uidmap +urllib +usecase +usecases +vcpus +vcputune +venv +verhash +vfat +videoclass virtualenv +virtualenvs virutalenv +VPRO workdir +xapi +XAPI +XCP-ng +xcp-python-libs +xcptestlib +xelogging +xenopsd +XenServer +xensource +xmldoc +xmlunwrap diff --git a/cspell.json b/cspell.json new file mode 100644 index 00000000..a25c1f71 --- /dev/null +++ b/cspell.json @@ -0,0 +1,48 @@ +// http://cspell.org/docs/getting-started/#2-add-words-to-the-project-dictionary +{ + "version": "0.2", + "language": "en-GB,en-US", + "dictionaryDefinitions": [ + { + "name": "cspell-workspace-dictionary", + "path": ".vscode/ltex.dictionary.en-US.txt", + "addWords": true + } + ], + "dictionaries": ["cspell-workspace-dictionary"], + "ignorePaths": [ + ".actrc", + ".pylintrc", + "Makefile", + "pyproject.toml", + "stubs/", + "tests/xcptestlib_unshare.py", + "tox.ini", + "xcp/cpiofile.py", + "xcp/net/ifrename/dynamic.py", + "xcp/net/ifrename/logic.py", + "xcp/net/ifrename/util.py", + "xcp/net/ip.py", + "xcp/repository.py", + "xcp-python-libs.spec.in" + ], + "ignoreRegExpList": [ + // exclude regular expressions from re.compile(pattern) + "re.compile(.*)", + // exclude MAC addresses + "MAC(.*)" + ], + "ignoreWords": [ + // In a log message, fix in final commit + "Succesfully", + // Volume label used in tests + "vgdorj", + // Unclear words in test method names + "nosrules", + "rshp", + "siobuff", + // Used to test an invalid quad + "efgh", + "ijkl" + ] +}