Skip to content

Commit

Permalink
Fix misspellings noted by the Code spell checker plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Bernhard Kaindl <[email protected]>
  • Loading branch information
bernhardkaindl committed Feb 27, 2024
1 parent 2d5478c commit a16f5ca
Show file tree
Hide file tree
Showing 15 changed files with 354 additions and 42 deletions.
23 changes: 17 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Further information:
# https://pre-commit.com/#automatically-enabling-pre-commit-on-repositories
# All hooks: https://pre-commit.com/hooks.html
fail_fast: true
fail_fast: false
default_stages: [commit, push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -103,12 +103,23 @@ repos:
additional_dependencies: [defusedxml, pytest, types-lxml, types-mock]


- repo: https://github.com/pycqa/pylint
rev: v3.0.3
- repo: https://github.com/pylint-dev/pylint
rev: v3.0.4
hooks:
- id: pylint
name: Run pylint to check that docstrings are added (and all other enabled checks)
log_file: ".git/pre-commit-pylint.log"
additional_dependencies: ['pylint[spelling]', pytest]
args: [--spelling-dict=en_US] # See the comment in .pylintrc
files: '(^xen-bugtool|\.py)$'


- repo: local
hooks:
- id: git-diff # Ref: https://github.com/pre-commit/pre-commit/issues/1712
name: Show not staged changes (fixups may make them too)
entry: sh -c '.vscode/ltex-sort-dictionary.sh && git diff --exit-code'
language: system
pass_filenames: false
always_run: true


# Run "python3 -m pip install -r requirements-dev.txt" to run pytest or use "git commit --no-verify":
Expand Down Expand Up @@ -160,7 +171,7 @@ repos:


- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.345
rev: v1.1.351
hooks:
- id: pyright
name: Run pyright to check the unit tests for any typing warnings (use for bugtool later)
Expand Down
22 changes: 21 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fail-on=redefined-variable-type
# number of processors available to use, and will cap the count on Windows to
# avoid hangs.
# defaults to: jobs=1
jobs=0
jobs=4

# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
Expand Down Expand Up @@ -306,6 +306,26 @@ default-docstring-type=default
min-similarity-lines=6


[SPELLING]

# Limits count of emitted suggestions for spelling mistakes.
max-spelling-suggestions=1

# Spelling dictionary name. Available dictionaries: en (aspell), en_AU
# (aspell), en_CA (aspell), en_GB (aspell), en_US (aspell).
# To support spelling checks for older python2 pylint versions,
# `sudo apt-get install -y libenchant-2-2` would be needed,
# so we enable it for newer Python3 pylint in .pre-commit-config.yaml:
#spelling-dict=en_US

# A path to a file that contains the private dictionary; one word per line.
spelling-private-dict-file=.vscode/ltex.dictionary.en-US.txt

# Tells whether to store unknown words to the private dictionary (see the
# --spelling-private-dict-file option) instead of raising a message.
spelling-store-unknown-words=no


[TYPING]
# Applications do not need runtime typing introspection:

Expand Down
16 changes: 0 additions & 16 deletions .pylintrc.project-dict.txt

This file was deleted.

16 changes: 16 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"recommendations": [
"adamvoss.vscode-languagetool",
"adamvoss.vscode-languagetool-en",
"almenon.arepl",
"dinhani.copy-on-select",
"ms-python.black-formatter",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.python",
"sourcery.sourcery",
"streetsidesoftware.code-spell-checker",
"timonwong.shellcheck",
"valentjn.vscode-ltex",
]
}
6 changes: 6 additions & 0 deletions .vscode/ltex-sort-dictionary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
sed 's/_/!/g' .vscode/ltex.dictionary.en-US.txt > .git/ltex.dictionary.en-US.txt
LC_COLLATE=C sort -fu .git/ltex.dictionary.en-US.txt >.vscode/ltex.dictionary.en-US.txt
sed -i 's/!/_/g' .vscode/ltex.dictionary.en-US.txt .git/ltex.dictionary.en-US.txt
diff -u .git/ltex.dictionary.en-US.txt .vscode/ltex.dictionary.en-US.txt &&
rm .git/ltex.dictionary.en-US.txt
257 changes: 257 additions & 0 deletions .vscode/ltex.dictionary.en-US.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
acpidump
arg
argl
args
ARPTABLES
attr
authkey
autoflake
autouse
basename
basepath
basestring
bindmount
BIOSDEVNAME
blktap
bool
br
BRCTL
buddyinfo
bugball
bugtool
bugtool's
builtins
capfd
caplog
capsys
certserial
cgrules
chdir
checkmark
CHKCONFIG
chrony
CHRONYC
chroot
cli
CLOEXEC
clusterd
Codecov
conf
CONFD
config
conftest
conftest-README
coredump
CRASHDUMP
CRASHDUMPS
CVSM
cwd
dbcache
dbfilter
defusedxml
dev
develpment
dhclient
dir
dircmp
dirs
docstrings
dp
dunder
efi
efivars
eg
egid
endgroup
ENOSPC
entrypoint
env
epoll
euid
exceptionless
explictly
fakefs
FCOE
fd
fds
fileno
filesystem
filetype
finalizer
firstboot
fs
getgid
getuid
gid
gidmap
HDPARM
http
HTTPResponse
hwconf
icdiff
inet
init
initialisation
initialised
initiatorname
iomem
ioports
iscsi
iscsid
isort
issuercert
json
junitxml
libc
LIVESET
localca
logfile
logfiles
LOSETUP
lowlevel
ltex
maxsplit
mdadm
mdstat
modinfo
mountpoint
mountpoints
mtime
multipathd
mypy
namespace
namespaces
netback
networkd
NEWNET
NEWNS
nonexisting
NRPE
nsswitch
nvme
O_CREAT
O_RDONLY
openvswitch
opterr
os
outfd
PAGETYINFO
pagetypeinfo
passwd
pems
pii
pragma
pre
prepend
proc
procs
pstree
pv
py
pyarrow
pyfakefs
pylint
pylintrc
pyright
pytest
pytest's
PYTHONDEVMODE
PYTHONDONTWRITEBYTECODE
pytype
rebase
reportMissingImports
reportUndefinedVariable
resolv
rootca
rrd
rrdd
rrds
sar
sbin
SETFD
setgroups
SIGUSR
slabinfo
snmp
snmpd
softirqs
softnet
sourcery
src
startswith
stderr
stdout
str
strerror
subarchive
subarchives
subclasses
subdir
subdirectory
subprocesses
swtpm
symlink
symref
sys
systemd
TAPDISK
tarbz
tarfd
tarfile
TEMPL
templatedir
testdir
tmp
tmpdata
tmpdir
tmpdir's
tmpfs
toolstack
toplevel
typeshed
UDEV
uid
uidmap
umount
unicode
unimported
unioned
unmount
Unrecognised
unshare
urlopen
usefixtures
usr
vdis
vendorkernel
virtualenv
VM
VMs
vswitch
vswitchd
VTPM
whitespace
WRONLY
xapi
xapidb
xc
xcp
xen
xen-bugtool
XenCenter
xenopsd
XENRT
xenserver
xenserver-status-report
xensource
xenstore
xfail
xhad
xml
xs
xsconfig
xsversion
xvda
yestoall
zipfile
zipfile's
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.RECIPEPREFIX=>
.PHONY: check darker-xen-bugtool pylint

check: darker-xen-bugtool pylint

DARKER_OPTS = --isort -tpy36 --skip-string-normalization -l88
darker-xen-bugtool:
Expand All @@ -9,3 +12,6 @@ darker-xen-bugtool:
> diff -u xen-bugtool $$tmp ;\
> if [ $$? != 0 ]; then cat $$tmp >xen-bugtool ;fi
>@ rm -f $$tmp

pylint:
> pylint xen-bugtool tests/*/*.py
Loading

0 comments on commit a16f5ca

Please sign in to comment.