diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index c133224..d004914 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -22,9 +22,6 @@ jobs: with: python-version: "3.10" - - name: Install Python dependencies - run: pip install black flake8 mypy pydantic types-requests - - name: Install Poetry uses: snok/install-poetry@v1 with: @@ -55,3 +52,6 @@ jobs: mypy: true mypy_args: "th_cli/main.py" mypy_command_prefix: "poetry run " + + - name: Run isort + run: poetry run isort --check-only th_cli diff --git a/scripts/generate_client.sh b/scripts/generate_client.sh index e6462ff..66addfd 100755 --- a/scripts/generate_client.sh +++ b/scripts/generate_client.sh @@ -20,4 +20,4 @@ PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)" #Using an array to store the arguments, to handle 'whitespaces' correctly args=("$@") -poetry run $PROJECT_ROOT/scripts/datamodel_generate_client.py "${args[@]}" +poetry run "$PROJECT_ROOT/scripts/datamodel_generate_client.py" "${args[@]}" diff --git a/scripts/lint.sh b/scripts/lint.sh index f51bd34..6dcc41a 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -e set -x PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)" diff --git a/scripts/th_cli_install.sh b/scripts/th_cli_install.sh index c8568a7..7b020f4 100755 --- a/scripts/th_cli_install.sh +++ b/scripts/th_cli_install.sh @@ -39,12 +39,12 @@ CHANGE_WARNING="# WARNING: This file was copied from the backend's $SHARED_CONST echo "Installing Matter CLI..." # Copy requirements from backend -if [ ! -f $SHARED_CONST_DIR/$SHARED_CONST_FILE ]; then +if [ ! -f "$SHARED_CONST_DIR/$SHARED_CONST_FILE" ]; then echo "Shared constants file not found in backend directory: $SHARED_CONST_DIR/$SHARED_CONST_FILE" exit 1 fi -cp -r $SHARED_CONST_DIR/$SHARED_CONST_FILE $PROJECT_ROOT/th_cli/ -sed -i "1s/^/#\n$CHANGE_WARNING\n/" $PROJECT_ROOT/th_cli/$SHARED_CONST_FILE # Add warning to the copied file +cp -r "$SHARED_CONST_DIR/$SHARED_CONST_FILE" "$PROJECT_ROOT/th_cli/" +sed -i "1s/^/#\n$CHANGE_WARNING\n/" "$PROJECT_ROOT/th_cli/$SHARED_CONST_FILE" # Add warning to the copied file # Check if pipx is installed if ! command -v pipx &> /dev/null; then