mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-05-26 23:36:16 +00:00
linters
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
/.tox/
|
||||||
|
/.mypy_cache/
|
||||||
/pkg/arch/pkg/
|
/pkg/arch/pkg/
|
||||||
/pkg/arch/src/
|
/pkg/arch/src/
|
||||||
/pkg/arch/v*.tar.gz
|
/pkg/arch/v*.tar.gz
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -92,12 +92,17 @@ $(BUILD)/%.o: %.c
|
|||||||
|
|
||||||
release:
|
release:
|
||||||
make clean
|
make clean
|
||||||
|
make tox
|
||||||
make push
|
make push
|
||||||
make bump
|
make bump
|
||||||
make push
|
make push
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
|
|
||||||
|
tox:
|
||||||
|
tox -q -c tox.ini $(if $(E),-e $(E),-p auto)
|
||||||
|
|
||||||
|
|
||||||
bump:
|
bump:
|
||||||
bumpversion $(if $(V),$(V),minor)
|
bumpversion $(if $(V),$(V),minor)
|
||||||
|
|
||||||
@@ -108,6 +113,7 @@ push:
|
|||||||
|
|
||||||
|
|
||||||
clean-all: clean
|
clean-all: clean
|
||||||
|
rm -rf .mypy-cache .tox
|
||||||
clean:
|
clean:
|
||||||
rm -rf pkg/arch/pkg pkg/arch/src pkg/arch/v*.tar.gz pkg/arch/ustreamer-*.pkg.tar.{xz,zst}
|
rm -rf pkg/arch/pkg pkg/arch/src pkg/arch/v*.tar.gz pkg/arch/ustreamer-*.pkg.tar.{xz,zst}
|
||||||
rm -rf $(PROG) $(BUILD) vgcore.* *.sock
|
rm -rf $(PROG) $(BUILD) vgcore.* *.sock
|
||||||
|
|||||||
9
linters/flake8.ini
Normal file
9
linters/flake8.ini
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[flake8]
|
||||||
|
inline-quotes = double
|
||||||
|
max-line-length = 160
|
||||||
|
ignore = W503, E227, E241, E252, Q003
|
||||||
|
# W503 line break before binary operator
|
||||||
|
# E227 missing whitespace around bitwise or shift operator
|
||||||
|
# E241 multiple spaces after
|
||||||
|
# E252 missing whitespace around parameter equals
|
||||||
|
# Q003 Change outer quotes to avoid escaping inner quotes
|
||||||
5
linters/mypy.ini
Normal file
5
linters/mypy.ini
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[mypy]
|
||||||
|
python_version = 3.8
|
||||||
|
ignore_missing_imports = true
|
||||||
|
disallow_untyped_defs = true
|
||||||
|
strict_optional = true
|
||||||
63
linters/pylint.ini
Normal file
63
linters/pylint.ini
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
[MASTER]
|
||||||
|
ignore = .git
|
||||||
|
|
||||||
|
[DESIGN]
|
||||||
|
min-public-methods = 0
|
||||||
|
max-args = 10
|
||||||
|
|
||||||
|
[TYPECHECK]
|
||||||
|
ignored-classes=
|
||||||
|
AioQueue,
|
||||||
|
|
||||||
|
[MESSAGES CONTROL]
|
||||||
|
disable =
|
||||||
|
file-ignored,
|
||||||
|
locally-disabled,
|
||||||
|
fixme,
|
||||||
|
missing-docstring,
|
||||||
|
no-init,
|
||||||
|
no-self-use,
|
||||||
|
superfluous-parens,
|
||||||
|
abstract-class-not-used,
|
||||||
|
abstract-class-little-used,
|
||||||
|
duplicate-code,
|
||||||
|
bad-continuation,
|
||||||
|
bad-whitespace,
|
||||||
|
star-args,
|
||||||
|
broad-except,
|
||||||
|
redundant-keyword-arg,
|
||||||
|
wrong-import-order,
|
||||||
|
too-many-ancestors,
|
||||||
|
no-else-return,
|
||||||
|
len-as-condition,
|
||||||
|
|
||||||
|
[REPORTS]
|
||||||
|
msg-template = {symbol} -- {path}:{line}({obj}): {msg}
|
||||||
|
|
||||||
|
[FORMAT]
|
||||||
|
max-line-length = 160
|
||||||
|
|
||||||
|
[BASIC]
|
||||||
|
# List of builtins function names that should not be used, separated by a comma
|
||||||
|
bad-functions =
|
||||||
|
|
||||||
|
# Good variable names which should always be accepted, separated by a comma
|
||||||
|
good-names = _, __, x, y, ws, make-html-h, make-jpeg-h
|
||||||
|
|
||||||
|
# Regular expression matching correct method names
|
||||||
|
method-rgx = [a-z_][a-z0-9_]{2,50}$
|
||||||
|
|
||||||
|
# Regular expression matching correct function names
|
||||||
|
function-rgx = [a-z_][a-z0-9_]{2,50}$
|
||||||
|
|
||||||
|
# Regular expression which should only match correct module level names
|
||||||
|
const-rgx = ([a-zA-Z_][a-zA-Z0-9_]*)$
|
||||||
|
|
||||||
|
# Regular expression which should only match correct argument names
|
||||||
|
argument-rgx = [a-z_][a-z0-9_]{1,30}$
|
||||||
|
|
||||||
|
# Regular expression which should only match correct variable names
|
||||||
|
variable-rgx = [a-z_][a-z0-9_]{1,30}$
|
||||||
|
|
||||||
|
# Regular expression which should only match correct instance attribute names
|
||||||
|
attr-rgx = [a-z_][a-z0-9_]{1,30}$
|
||||||
48
tox.ini
Normal file
48
tox.ini
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
[tox]
|
||||||
|
envlist = cppcheck, flake8, pylint, mypy, vulture
|
||||||
|
skipsdist = true
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
basepython = python3.8
|
||||||
|
sitepackages = true
|
||||||
|
|
||||||
|
[testenv:cppcheck]
|
||||||
|
whitelist_externals = cppcheck
|
||||||
|
commands = cppcheck \
|
||||||
|
--force \
|
||||||
|
--std=c11 \
|
||||||
|
--error-exitcode=1 \
|
||||||
|
--quiet \
|
||||||
|
--enable=warning,unusedFunction,portability,performance,style \
|
||||||
|
--suppress=assignmentInAssert \
|
||||||
|
--suppress=variableScope \
|
||||||
|
--inline-suppr \
|
||||||
|
-DCHAR_BIT=8 \
|
||||||
|
src
|
||||||
|
|
||||||
|
[testenv:flake8]
|
||||||
|
whitelist_externals = bash
|
||||||
|
commands = bash -c 'flake8 --config=linters/flake8.ini tools/*.py'
|
||||||
|
# FIXME: pyflakes from master to support walrus
|
||||||
|
deps =
|
||||||
|
git+https://github.com/PyCQA/pyflakes@1911c20#egg=pyflakes
|
||||||
|
flake8
|
||||||
|
flake8-quotes
|
||||||
|
|
||||||
|
[testenv:pylint]
|
||||||
|
whitelist_externals = bash
|
||||||
|
commands = bash -c 'pylint --rcfile=linters/pylint.ini --output-format=colorized --reports=no tools/*.py'
|
||||||
|
deps =
|
||||||
|
pylint
|
||||||
|
|
||||||
|
[testenv:mypy]
|
||||||
|
whitelist_externals = bash
|
||||||
|
commands = bash -c 'mypy --config-file=linters/mypy.ini tools/*.py'
|
||||||
|
deps =
|
||||||
|
mypy
|
||||||
|
|
||||||
|
[testenv:vulture]
|
||||||
|
whitelist_externals = bash
|
||||||
|
commands = bash -c 'vulture tools/*.py'
|
||||||
|
deps =
|
||||||
|
vulture
|
||||||
Reference in New Issue
Block a user