diff options
Diffstat (limited to 'development/codespell')
-rw-r--r-- | development/codespell/README | 5 | ||||
-rw-r--r-- | development/codespell/codespell.1 | 166 | ||||
-rw-r--r-- | development/codespell/codespell.SlackBuild | 80 | ||||
-rw-r--r-- | development/codespell/codespell.info | 10 | ||||
-rw-r--r-- | development/codespell/slack-desc | 19 |
5 files changed, 280 insertions, 0 deletions
diff --git a/development/codespell/README b/development/codespell/README new file mode 100644 index 0000000000..cdbc979cec --- /dev/null +++ b/development/codespell/README @@ -0,0 +1,5 @@ +codespell (spell checker for source code) + +codespell fixes common misspellings in text files. It's designed +primarily for checking misspelled words in source code, but it can be +used with other files as well. diff --git a/development/codespell/codespell.1 b/development/codespell/codespell.1 new file mode 100644 index 0000000000..54076d32e1 --- /dev/null +++ b/development/codespell/codespell.1 @@ -0,0 +1,166 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. +.TH CODESPELL "1" "January 2023" "codespell 2.1.0" "User Commands" +.SH NAME +codespell \- detect spelling mistakes in source code +.SH SYNOPSIS +\fBcodespell\fR [OPTIONS] [file1 file2 ... fileN] +.SH DESCRIPTION +.PP +codespell is designed to find and fix common misspellings in text files. +It is designed primarily for checking misspelled words in source code, +but it can be used with other files as well. +.PP +usage: codespell [\-h] [\-\-version] [\-d] [\-c] [\-w] [\-D DICTIONARY] +.IP +[\-\-builtin BUILTIN\-LIST] [\-\-ignore\-regex IGNORE_REGEX] +[\-I FILE] [\-L WORDS] [\-\-uri\-ignore\-words\-list WORDS] +[\-r REGEX] [\-\-uri\-regex URI_REGEX] [\-s] [\-\-count] [\-S SKIP] +[\-x FILE] [\-i INTERACTIVE] [\-q QUIET_LEVEL] [\-e] [\-f] [\-H] +[\-A LINES] [\-B LINES] [\-C LINES] [\-\-config CONFIG] +[files ...] +.SS "positional arguments:" +.TP +files +files or directories to check +.SS "optional arguments:" +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-\-version\fR +show program's version number and exit +.TP +\fB\-d\fR, \fB\-\-disable\-colors\fR +disable colors, even when printing to terminal (always +set for Windows) +.TP +\fB\-c\fR, \fB\-\-enable\-colors\fR +enable colors, even when not printing to terminal +.TP +\fB\-w\fR, \fB\-\-write\-changes\fR +write changes in place if possible +.TP +\fB\-D\fR DICTIONARY, \fB\-\-dictionary\fR DICTIONARY +custom dictionary file that contains spelling +corrections. If this flag is not specified or equals +"\-" then the default dictionary is used. This option +can be specified multiple times. +.TP +\fB\-\-builtin\fR BUILTIN\-LIST +comma\-separated list of builtin dictionaries to +include (when "\-D \-" or no "\-D" is passed). Current +options are: +\- 'clear' for unambiguous errors +\- 'rare' for rare but valid words +\- 'informal' for making informal words more formal +\- 'usage' for replacing phrasing with recommended +.TP +terms +\- 'code' for words common to code and/or mathematics +.TP +that might be typos +\- 'names' for valid proper names that might be typos +\- 'en\-GB_to_en\-US' for corrections from en\-GB to en\-US +The default is 'clear,rare'. +.TP +\fB\-\-ignore\-regex\fR IGNORE_REGEX +regular expression which is used to find patterns to +ignore by treating as whitespace. When writing regular +expressions, consider ensuring there are boundary nonword chars, e.g., "\ebmatch\eb". Defaults to +empty/disabled. +.TP +\fB\-I\fR FILE, \fB\-\-ignore\-words\fR FILE +file that contains words which will be ignored by +codespell. File must contain 1 word per line. Words +are case sensitive based on how they are written in +the dictionary file +.TP +\fB\-L\fR WORDS, \fB\-\-ignore\-words\-list\fR WORDS +comma separated list of words to be ignored by +codespell. Words are case sensitive based on how they +are written in the dictionary file +.TP +\fB\-\-uri\-ignore\-words\-list\fR WORDS +comma separated list of words to be ignored by +codespell in URIs and emails only. Words are case +sensitive based on how they are written in the +dictionary file. If set to "*", all misspelling in +URIs and emails will be ignored. +.TP +\fB\-r\fR REGEX, \fB\-\-regex\fR REGEX +regular expression which is used to find words. By +default any alphanumeric character, the underscore, +the hyphen, and the apostrophe is used to build words. +This option cannot be specified together with \fB\-\-writechanges\fR. +.TP +\fB\-\-uri\-regex\fR URI_REGEX +regular expression which is used to find URIs and +emails. A default expression is provided. +.TP +\fB\-s\fR, \fB\-\-summary\fR +print summary of fixes +.TP +\fB\-\-count\fR +print the number of errors as the last line of stderr +.TP +\fB\-S\fR SKIP, \fB\-\-skip\fR SKIP +comma\-separated list of files to skip. It accepts +globs as well. E.g.: if you want codespell to skip +\&.eps and .txt files, you'd give "*.eps,*.txt" to this +option. +.TP +\fB\-x\fR FILE, \fB\-\-exclude\-file\fR FILE +FILE with lines that should not be checked for errors +or changed +.TP +\fB\-i\fR INTERACTIVE, \fB\-\-interactive\fR INTERACTIVE +set interactive mode when writing changes: +\- 0: no interactivity. +\- 1: ask for confirmation. +\- 2: ask user to choose one fix when more than one is +.TP +available. +\- 3: both 1 and 2 +.TP +\fB\-q\fR QUIET_LEVEL, \fB\-\-quiet\-level\fR QUIET_LEVEL +bitmask that allows suppressing messages: +\- 0: print all messages. +\- 1: disable warnings about wrong encoding. +\- 2: disable warnings about binary files. +\- 4: omit warnings about automatic fixes that were +.TP +disabled in the dictionary. +\- 8: don't print anything for non\-automatic fixes. +\- 16: don't print the list of fixed files. +As usual with bitmasks, these levels can be combined; +e.g. use 3 for levels 1+2, 7 for 1+2+4, 23 for +1+2+4+16, etc. The default mask is 2. +.TP +\fB\-e\fR, \fB\-\-hard\-encoding\-detection\fR +use chardet to detect the encoding of each file. This +can slow down codespell, but is more reliable in +detecting encodings other than utf\-8, iso8859\-1, and +ascii. +.TP +\fB\-f\fR, \fB\-\-check\-filenames\fR +check file names as well +.TP +\fB\-H\fR, \fB\-\-check\-hidden\fR +check hidden files and directories (those starting +with ".") as well. +.TP +\fB\-A\fR LINES, \fB\-\-after\-context\fR LINES +print LINES of trailing context +.TP +\fB\-B\fR LINES, \fB\-\-before\-context\fR LINES +print LINES of leading context +.TP +\fB\-C\fR LINES, \fB\-\-context\fR LINES +print LINES of surrounding context +.TP +\fB\-\-config\fR CONFIG +path to config file. +.SH AUTHOR +Lucas De Marchi <lucas.de.marchi@gmail.com> +.SH "SEE ALSO" +https://github.com/codespell-project/codespell diff --git a/development/codespell/codespell.SlackBuild b/development/codespell/codespell.SlackBuild new file mode 100644 index 0000000000..74ec393dc3 --- /dev/null +++ b/development/codespell/codespell.SlackBuild @@ -0,0 +1,80 @@ +#!/bin/bash + +# Slackware build script for codespell + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20230820 bkw: update for 2.2.5, *many* thanks to fourtysixandtwo for +# his python3-setuptools-opt build, and for figuring out the bug in +# this build's pyproject.toml. + +# 20230115 bkw: update for 2.2.1, not the latest (see README). + +# 20210829 bkw: +# - update for 2.1.0. +# - use python3 by default. add PYVER var to force building with 2, +# but don't document it (nobody should need it). +# - add example/ to the doc dir. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=codespell +VERSION=${VERSION:-2.2.6} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + + +# write_to directive is broken, turns out we can do without it. +sed -i '/^write_to/d' pyproject.toml + +PYVER=$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])') +export PYTHONPATH=/opt/python$PYVER/site-packages/ + +python3 -m build --no-isolation +python3 -m installer -d "$PKG" dist/*.whl + +# upstream removed the man page. including a copy of the 2.1.0 man page, +# which seems to still apply to 2.2.1 (all the options are the same). +mkdir -p $PKG/usr/man/man1 +gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README* COPYING $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/development/codespell/codespell.info b/development/codespell/codespell.info new file mode 100644 index 0000000000..4782d3361e --- /dev/null +++ b/development/codespell/codespell.info @@ -0,0 +1,10 @@ +PRGNAM="codespell" +VERSION="2.2.6" +HOMEPAGE="https://pypi.org/project/codespell/" +DOWNLOAD="https://files.pythonhosted.org/packages/source/c/codespell/codespell-2.2.6.tar.gz" +MD5SUM="807149428419840f87ce3b3f2ab4ce38" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="python3-setuptools-opt" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/development/codespell/slack-desc b/development/codespell/slack-desc new file mode 100644 index 0000000000..bf1da3cc6f --- /dev/null +++ b/development/codespell/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +codespell: codespell (spell checker for source code) +codespell: +codespell: codespell fixes common misspellings in text files. It's designed +codespell: primarily for checking misspelled words in source code, but it can be +codespell: used with other files as well. +codespell: +codespell: +codespell: +codespell: +codespell: +codespell: |