Commit 37cdfa61 authored by Tomas Krizek's avatar Tomas Krizek

gitlabci: unify pylint, flake8 and lua linters

parent 905cc6ac
......@@ -150,12 +150,14 @@ lint:pedantic:
-Wpedantic -Wno-newline-eof -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-folding-constant'
- ninja -C build_pedantic_clang
lint:luacheck:
lint:other:
<<: *test_nodep
stage: test
script:
- meson build_ci_luacheck
- ninja -C build_ci_luacheck luacheck
- meson build_ci_lint
- ninja -C build_ci* pylint
- ninja -C build_ci* flake8
- ninja -C build_ci* luacheck
lint:scan-build:
<<: *test
......
#!/bin/bash
python3 -m flake8 --max-line-length=100 tests/pytests
FLAKE8=$?
ci/pytests/pylint-run.sh
PYLINT=$?
if [ $PYLINT -ne 0 ]; then
exit 1
fi
if [ $FLAKE8 -ne 0 ]; then
exit 1
fi
exit 0
#!/bin/bash
# Execute extended, long-running test suite
python3 -m pytest -ra --capture=no tests/pytests/conn_flood.py
#!/bin/bash
python3 -m pytest --html pytests.html --self-contained-html -dn 24 tests/pytests
......@@ -20,13 +20,6 @@ luajit = dependency('luajit')
message('------------------------------')
# TODO coverage
#lcov = find_program('lcov', required: false)
#luacov = find_program('luacov', required: false)
# TODO lint
# Variables
libkres_soversion = 9
......@@ -183,6 +176,8 @@ install_data(
message('--- lint dependencies ---')
clangtidy = find_program('clang-tidy', required: false)
luacheck = find_program('luacheck', required: false)
flake8 = find_program('flake8', required: false)
pylint_run = find_program('scripts/run-pylint.sh')
message('-------------------------')
if clangtidy.found()
......@@ -207,6 +202,22 @@ if luacheck.found()
)
endif
if flake8.found()
run_target(
'flake8',
command: [
flake8,
'--max-line-length=100',
join_paths(meson.source_root(), 'tests', 'pytests'),
],
)
endif
run_target(
'pylint',
command: pylint_run,
)
# Summary message
# NOTE: ternary operator in format() not supported
......@@ -217,6 +228,7 @@ s_build_client = build_client ? 'enabled' : 'disabled'
s_build_unit_tests = build_unit_tests ? 'enabled' : 'disabled'
s_build_postinstall_tests = build_postinstall_tests ? 'enabled' : 'disabled'
s_install_kresd_conf = install_kresd_conf ? 'enabled' : 'disabled'
# TODO mention dnstap installation?
message('''
======================= SUMMARY =======================
......
#!/usr/bin/env bash
set -e
#!/bin/bash
set -o errexit -o nounset
cd "$(dirname ${0})/.."
# Find Python modules and standalone Python scripts
FILES=$(find ./tests/pytests \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment