Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-desroches committed Aug 7, 2024
1 parent ec9c781 commit ccc9645
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,20 @@ jobs:
cd $STRIPPED_DIR
${{ env.RUN }} "release/check-dirty.sh && \
MAX_EXAMPLES=5 $PYTEST -m 'not slow' selfdrive/car"
- name: Getting modified files
timeout-minutes: 1
run: |
cd $GITHUB_WORKSPACE
git fetch --unshallow --recurse-submodules=no origin master:master
ALL_FILES=$(git diff --name-only --cached --diff-filter=AM $(git merge-base HEAD master))
cd $STRIPPED_DIR
VALID_FILES=""
for f in $ALL_FILES; do
if [[ -f "$f" ]]; then
VALID_FILES+="$f "
fi
done
echo FILES=$(echo $VALID_FILES) >> $GITHUB_ENV
echo FILES=$(echo $ALL_FILES) >> $GITHUB_ENV
- name: Static analysis
timeout-minutes: 1
run: |
cd $GITHUB_WORKSPACE
cp pyproject.toml $STRIPPED_DIR
cd $STRIPPED_DIR
${{ env.RUN }} "scripts/lint.sh '$(echo $FILES | tr " " "\n")'"
${{ env.RUN }} "scripts/lint.sh $FILES"
build:
strategy:
Expand Down
11 changes: 10 additions & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ function run_tests() {
ALL_FILES=$(echo "$@" | sed -E "s/$IGNORED_FILES//g")
PYTHON_FILES=$(echo "$ALL_FILES" | grep --color=never '.py$' || true)
echo $ALL_FILES
echo $PYTHON_FILES
if [[ -n "$PYTHON_FILES" ]]; then
run "ruff" ruff check $PYTHON_FILES --quiet
run "mypy" mypy $PYTHON_FILES
Expand All @@ -55,7 +58,13 @@ function run_tests() {
}
if [[ -n $@ ]]; then
run_tests "$@"
VALID_FILES=""
for f in $@; do
if [[ -f "$f" ]]; then
VALID_FILES+="$f "
fi
done
run_tests "$(echo $VALID_FILES | tr " " "\n")"
else
run_tests "$(git diff --name-only --cached --diff-filter=AM $(git merge-base HEAD master))"
fi
1 change: 1 addition & 0 deletions selfdrive/ui/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtWidgets import QLabel, QWidget, QVBoxLayout, QStackedLayout, QApplication
from openpilot.selfdrive.ui.qt.python_helpers import set_main_window
#aaaaa


if __name__ == "__main__":
Expand Down

0 comments on commit ccc9645

Please sign in to comment.