Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .github/workflows/repo.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .pre-commit-config.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
output:
- meta # Print lefthook version
- summary # Print summary block (successful and failed steps)
- empty_summary # Print summary heading when there are no steps to run
- success # Print successful steps
- failure # Print failed steps printing
- execution # Print any execution logs
#- execution_out # Print execution output
#- execution_info # Print `EXECUTE > ...` logging
- skips # Print "skip" (i.e. no files matched)

test:
parallel: true
commands:
# *** static analysis ***
ruff:
run: ruff check .
ty:
run: ty check .
codespell:
run: codespell {files} -L ned,stdio,master --builtin clear,rare,informal,usage,code,names,en-GB_to_en-US -S uv.lock,*_pyx.cpp,catch2*
files: git ls-tree -r HEAD --name-only
cppcheck:
run: cppcheck --error-exitcode=1 --inline-suppr --language=c++ --force --quiet -j4 --check-level=exhaustive $(git ls-files '*.cc' | grep -v -E '(msgq_tests|test_runner)\.cc')
cpplint:
run: cpplint --exclude=msgq/catch2/ --exclude=msgq/ipc_pyx.cpp --exclude=msgq/visionipc/visionipc_pyx.cpp --recursive --quiet --counting=detailed --linelength=240 --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces msgq/

# *** tests ***
test_runner:
run: msgq/test_runner
pytest:
run: pytest
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ dependencies = [
"setuptools", # for distutils
"Cython",
"scons",
"pre-commit",
"ruff",
"parameterized",
"coverage",
"numpy",
"pytest",
"pytest-retry",
"cppcheck",
"cpplint",
"codespell",
"ty",
"lefthook",
]

# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
Expand Down
6 changes: 4 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ PLATFORM=$(uname -s)

echo "installing dependencies"
if [[ $PLATFORM == "Darwin" ]]; then
export HOMEBREW_NO_AUTO_UPDATE=1
brew install python3 zeromq
if ! command -v python3 &>/dev/null || ! pkg-config --exists libzmq 2>/dev/null; then
export HOMEBREW_NO_AUTO_UPDATE=1
brew install python3 zeromq
fi
elif [[ $PLATFORM == "Linux" ]]; then
# for AGNOS since we clear the apt lists
if [[ ! -d /"var/lib/apt/" ]]; then
Expand Down
16 changes: 7 additions & 9 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
#!/usr/bin/env bash
#!/bin/bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR

# *** env setup ***
source ./setup.sh

# *** build ***
scons -j8

# *** lint ***
ty check .
#ruff check .
pre-commit run --all-files
# *** lint + test ***
lefthook run test

# *** test ***
msgq/test_runner
pytest
# *** all done ***
GREEN='\033[0;32m'
NC='\033[0m'
printf "\n${GREEN}All good!${NC} Finished build, lint, and test in ${SECONDS}s\n"
Loading