From 9d37dabe8460572107c7234d47071e36e9ef5aa7 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 21 Jul 2024 15:23:34 -0400 Subject: [PATCH] Use ruff check because ruff suggests it (#33) * Use ruff --check because ruff suggests it * lint --- .github/workflows/ci.yml | 4 ++-- wgpu_shadertoy/api.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41cd95a..b9666f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: run: | set -ex ruff format --check . - ruff . + ruff check . lint-wheel: name: Check Wheel @@ -168,4 +168,4 @@ jobs: files: 'dist/*.tar.gz;dist/*.whl' repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/wgpu_shadertoy/api.py b/wgpu_shadertoy/api.py index 0ccd845..a142901 100644 --- a/wgpu_shadertoy/api.py +++ b/wgpu_shadertoy/api.py @@ -140,7 +140,9 @@ def shader_args_from_json(dict_or_path, **kwargs) -> dict: for r_pass in shader_data["Shader"]["renderpass"]: if r_pass["type"] == "image": main_image_code = r_pass["code"] - if r_pass["inputs"] is not []: + # Check that r_pass["inputs"] is not empty + # before processing it + if r_pass["inputs"]: inputs, inputs_complete = _download_media_channels( r_pass["inputs"], use_cache=use_cache )