๐Ÿ“ฆ empicano / aiomqtt

๐Ÿ“„ check ยท 36 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36#!/usr/bin/env bash

# Safety first
set -o errexit -o pipefail -o nounset
# Change into the project's directory
cd "$(dirname "$0")/.."

# Set defaults
dry=false

# Parse arguments
for i in "$@"; do
  case $i in
    --dry)
      dry=true
      shift
      ;;
    --*)
      echo "Unknown option $i"
      exit 1
      ;;
    *)
      ;;
  esac
done

# Run checks
if [ "${dry}" = true ]; then
  uv run ruff check aiomqtt tests
  uv run ruff format --check --diff aiomqtt tests
else
  uv run ruff check --fix aiomqtt tests
  uv run ruff format aiomqtt tests
fi
uv run mypy aiomqtt tests --junit-xml="reports/mypy.xml"