Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint using code_quality_tool fails #20864

Open
Nishikoh opened this issue May 1, 2024 · 0 comments
Open

Lint using code_quality_tool fails #20864

Nishikoh opened this issue May 1, 2024 · 0 comments
Labels
backend: Adhoc Adhoc backend-related issues bug

Comments

@Nishikoh
Copy link
Contributor

Nishikoh commented May 1, 2024

Describe the bug

Added new lint for refurb using code_quality_tool target. Sometimes this lint fails and sometimes it succeeds. This behavior may be a bug in code_quality_tool or in the lint.

Pants version

2.20.0

OS

Linux(GitHub Actions Ubuntu 22.04)

Additional info

error log

$ pants --changed-since=origin/main --changed-dependents=transitive lint

10:26:46.91 [INFO] Preserving local process execution dir /tmp/pants-sandbox-klRECX for Searching for `bash` on PATH=/usr/bin:/bin:/usr/local/bin:/opt/homebrew/bin
10:26:46.92 [INFO] Preserving local process execution dir /tmp/pants-sandbox-aQpQKF for Test binary /bin/bash.
10:26:46.92 [INFO] Preserving local process execution dir /tmp/pants-sandbox-RRxRFc for Test binary /usr/bin/bash.
10:26:46.94 [INFO] Preserving local process execution dir /tmp/pants-sandbox-A22wfv for Searching for `git` on PATH=/usr/bin:/bin:/usr/local/bin:/opt/homebrew/bin

10:26:51.63 [INFO] Preserving local process execution dir /tmp/pants-sandbox-A8GQ0y for Find interpreter for constraints: CPython!=3.11.0,==3.11.*
10:26:51.76 [INFO] Preserving local process execution dir /tmp/pants-sandbox-iZUXIl for Searching for `tar` on PATH=/usr/bin:/bin:/usr/local/bin:/opt/homebrew/bin
10:26:51.79 [INFO] Preserving local process execution dir /tmp/pants-sandbox-Tzdbep for Test binary /bin/tar.
10:26:51.82 [INFO] Preserving local process execution dir /tmp/pants-sandbox-z6CG6l for Test binary /usr/bin/tar.
10:26:51.85 [INFO] Preserving local process execution dir /tmp/pants-sandbox-3ptIUZ for Extract shellcheck-v0.8.0.linux.x86_64.tar.gz
10:26:52.13 [INFO] Preserving local process execution dir /tmp/pants-sandbox-qMS9Dz for Detect Shell imports for 3rdparty/python/update_dep.sh
10:26:53.73 [INFO] Starting: Building dockerfile_parser.pex from resource://pants.backend.docker.subsystems/dockerfile.lock
10:26:53.73 [INFO] Preserving local process execution dir /tmp/pants-sandbox-CzXqOp for Building dockerfile_parser.pex from resource://pants.backend.docker.subsystems/dockerfile.lock
10:26:56.91 [INFO] Canceled: Building dockerfile_parser.pex from resource://pants.backend.docker.subsystems/dockerfile.lock
10:26:56.92 [INFO] Preserving local process execution dir /tmp/pants-sandbox-l5K8ZU for Parse Dockerfile.
10:26:56.92 [INFO] Preserving local process execution dir /tmp/pants-sandbox-o66PEK for Parse Dockerfile.
10:26:57.85 [INFO] Preserving local process execution dir /tmp/pants-sandbox-EzzgoC for Parse Dockerfile.
10:26:57.85 [INFO] Preserving local process execution dir /tmp/pants-sandbox-bEr30s for Parse Dockerfile.
10:26:57.97 [INFO] Preserving local process execution dir /tmp/pants-sandbox-2rFVk7 for Parse Dockerfile.
10:26:57.98 [INFO] Preserving local process execution dir /tmp/pants-sandbox-NSsDmU for Parse Dockerfile.
10:26:58.07 [INFO] Preserving local process execution dir /tmp/pants-sandbox-dDQDlC for Parse Dockerfile.
10:26:58.13 [INFO] Preserving local process execution dir /tmp/pants-sandbox-r1o4rc for Parse Dockerfile.
10:26:58.20 [INFO] Preserving local process execution dir /tmp/pants-sandbox-EzlS78 for Parse Dockerfile.
10:26:58.24 [INFO] Preserving local process execution dir /tmp/pants-sandbox-96Mtku for Parse Dockerfile.
10:26:58.35 [INFO] Preserving local process execution dir /tmp/pants-sandbox-Y1YTok for Parse Dockerfile.
10:26:58.38 [INFO] Preserving local process execution dir /tmp/pants-sandbox-bFo5n1 for Parse Dockerfile.
10:26:58.50 [INFO] Preserving local process execution dir /tmp/pants-sandbox-8vWk57 for Parse Dockerfile.
10:26:58.52 [INFO] Preserving local process execution dir /tmp/pants-sandbox-3CLtbO for Parse Dockerfile.
10:26:58.62 [INFO] Preserving local process execution dir /tmp/pants-sandbox-Hzxb3e for Parse Dockerfile.
10:26:58.85 [INFO] Completed: Check for visibility rule violations - visibility succeeded.
10:26:58.85 [INFO] Completed: Check for visibility rule violations - visibility succeeded.
10:26:58.87 [INFO] Starting: Building add_trailing_comma.pex from resource://pants.backend.python.lint.add_trailing_comma/add_trailing_comma.lock
10:26:58.87 [INFO] Preserving local process execution dir /tmp/pants-sandbox-es7OVR for Building add_trailing_comma.pex from resource://pants.backend.python.lint.add_trailing_comma/add_trailing_comma.lock
10:26:58.91 [INFO] Starting: Building pyupgrade.pex
10:26:58.91 [INFO] Preserving local process execution dir /tmp/pants-sandbox-cpsnrD for Building pyupgrade.pex
10:26:58.98 [INFO] Canceled: Building add_trailing_comma.pex from resource://pants.backend.python.lint.add_trailing_comma/add_trailing_comma.lock
10:26:58.98 [INFO] Starting: Building add_trailing_comma.pex from resource://pants.backend.python.lint.add_trailing_comma/add_trailing_comma.lock
10:26:58.98 [INFO] Preserving local process execution dir /tmp/pants-sandbox-ZISLW9 for Building add_trailing_comma.pex from resource://pants.backend.python.lint.add_trailing_comma/add_trailing_comma.lock
10:26:59.66 [INFO] Canceled: Building add_trailing_comma.pex from resource://pants.backend.python.lint.add_trailing_comma/add_trailing_comma.lock
10:26:59.66 [INFO] Starting: Building pydocstyle.pex from resource://pants.backend.python.lint.pydocstyle/pydocstyle.lock
10:26:59.66 [INFO] Preserving local process execution dir /tmp/pants-sandbox-ve7tDB for Building pydocstyle.pex from resource://pants.backend.python.lint.pydocstyle/pydocstyle.lock
10:26:59.71 [INFO] Completed: Lint with Hadolint - hadolint succeeded.

10:26:59.98 [INFO] Canceled: Building pyupgrade.pex
10:26:59.98 [INFO] Starting: Building isort.pex from resource://pants.backend.python.lint.isort/isort.lock
10:26:59.98 [INFO] Preserving local process execution dir /tmp/pants-sandbox-GukM0x for Building isort.pex from resource://pants.backend.python.lint.isort/isort.lock
10:27:00.12 [INFO] Canceled: Building isort.pex from resource://pants.backend.python.lint.isort/isort.lock
10:27:00.12 [INFO] Starting: Building bandit.pex from resource://pants.backend.python.lint.bandit/bandit.lock
10:27:00.12 [INFO] Preserving local process execution dir /tmp/pants-sandbox-uzvKrR for Building bandit.pex from resource://pants.backend.python.lint.bandit/bandit.lock
10:27:00.16 [INFO] Canceled: Building pydocstyle.pex from resource://pants.backend.python.lint.pydocstyle/pydocstyle.lock
10:27:00.16 [INFO] Starting: Building local_dists.pex
10:27:00.16 [INFO] Preserving local process execution dir /tmp/pants-sandbox-ONnmqr for Building local_dists.pex
10:27:00.87 [INFO] Completed: Lint with Pydocstyle - pydocstyle succeeded.
10:27:00.87 [INFO] Completed: Format with docformatter - docformatter made no changes.
10:27:00.96 [INFO] Canceled: Building local_dists.pex
10:27:00.96 [INFO] Starting: Building 1 requirement for ruff.pex from the 3rdparty/python/ruff.lock resolve: ruff>=0.0.287
10:27:00.96 [INFO] Preserving local process execution dir /tmp/pants-sandbox-CeAGDn for Building 1 requirement for ruff.pex from the 3rdparty/python/ruff.lock resolve: ruff>=0.0.287
10:27:00.97 [INFO] Canceled: Building bandit.pex from resource://pants.backend.python.lint.bandit/bandit.lock
10:27:00.97 [INFO] Preserving local process execution dir /tmp/pants-sandbox-OSxz1c for Extract taplo-linux-x86_64.gz
10:27:01.09 [INFO] Completed: Lint with Flake8 - flake8 succeeded.
Partition: ['CPython!=3.11.0,==3.11.*']


10:27:01.16 [INFO] Preserving local process execution dir /tmp/pants-sandbox-3RgefL for Run add-trailing-comma on 63 files.
10:27:01.17 [INFO] Completed: Format with add-trailing-comma - add-trailing-comma made no changes.
10:27:01.17 [INFO] Preserving local process execution dir /tmp/pants-sandbox-j3HxWP for Run Autoflake on 63 files.
10:27:01.23 [INFO] Completed: Lint with Bandit - bandit succeeded.
Partition: ['CPython!=3.11.0,==3.11.*']


10:27:01.31 [INFO] Canceled: Building 1 requirement for ruff.pex from the 3rdparty/python/ruff.lock resolve: ruff>=0.0.287
10:27:01.32 [INFO] Preserving local process execution dir /tmp/pants-sandbox-8kwsJx for Run pyupgrade on 63 files.
10:27:02.52 [INFO] Starting: Building 1 requirement for refurb.pex from the pants-plugin/private/lockfile.lock resolve: refurb
10:27:02.52 [INFO] Preserving local process execution dir /tmp/pants-sandbox-9duGPD for Building 1 requirement for refurb.pex from the pants-plugin/private/lockfile.lock resolve: refurb
10:27:02.52 [INFO] Completed: Fix with Autoflake - autoflake made no changes.
10:27:02.53 [INFO] Preserving local process execution dir /tmp/pants-sandbox-uoP1L1 for Run taplo on 3 files.
10:27:02.53 [INFO] Completed: Fix with pyupgrade - pyupgrade made no changes.
10:27:02.58 [INFO] Preserving local process execution dir /tmp/pants-sandbox-LmknzW for Run isort on 63 files.
10:27:02.59 [INFO] Completed: Format with taplo - taplo made no changes.
10:27:03.19 [INFO] Preserving local process execution dir /tmp/pants-sandbox-yDm3ar for Run ruff check --force-exclude on 41 files.
10:27:03.19 [INFO] Completed: Format with isort - isort made no changes.
10:27:03.45 [INFO] Completed: Format with Ruff - ruff made no changes.
10:27:03.61 [INFO] Completed: Format with `ruff format` - ruff format made no changes.
10:27:03.67 [INFO] Completed: Lint with `ruff check` - ruff check succeeded.
All checks passed!




10:27:04.76 [INFO] Canceled: Building 1 requirement for refurb.pex from the pants-plugin/private/lockfile.lock resolve: refurb
10:27:04.76 [INFO] Starting: Running code quality tool
10:27:04.76 [INFO] Preserving local process execution dir /tmp/pants-sandbox-Sej4Pc for Running code quality tool
10:27:05.92 [INFO] Completed: Running code quality tool
10:27:05.92 [ERROR] Completed: pants.backend.adhoc.code_quality_tool.CodeQualityToolRuleBuilder._build_lint_rules.run_code_quality_refurb - refurb failed (exit code 127).
./.cache/pex_root/venvs/xxxxxx7560e98b620dddd609b72c67/85779a5bf03739c4b657db4628cabf6cef3cb01d/pex: No such file or directory




✓ add-trailing-comma succeeded.
✓ autoflake succeeded.
✓ bandit succeeded.
✓ docformatter succeeded.
✓ flake8 succeeded.
✓ hadolint succeeded.
✓ isort succeeded.
✓ pydocstyle succeeded.
✓ pyupgrade succeeded.
✕ refurb failed.
✓ ruff succeeded.
✓ ruff check succeeded.
✓ ruff format succeeded.
✓ taplo succeeded.
✓ visibility succeeded.

BUILD

python_requirement(
    name="refurb_req",
    requirements=["refurb"],
)

code_quality_tool(
    name="refurb",
    runnable=":refurb_req",
    file_glob_include=["**/*.py"],
)
@Nishikoh Nishikoh added the bug label May 1, 2024
@huonw huonw added the backend: Adhoc Adhoc backend-related issues label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Adhoc Adhoc backend-related issues bug
Projects
None yet
Development

No branches or pull requests

2 participants