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

[Bug]: Incorrect suggestion to fix format #482

Open
nicu1989 opened this issue Feb 14, 2025 · 0 comments
Open

[Bug]: Incorrect suggestion to fix format #482

nicu1989 opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@nicu1989
Copy link

What happened?

The suggested output of format check is the same as the format command.

I have 2 targets:

format_multirun(
    name = "format.fix",
    python = "@aspect_rules_lint//format:ruff",

and

format_test(
    name = "format.check",
    python = "@aspect_rules_lint//format:ruff",

The resulting targets are:

# Current targets
//tools/format:BUILD
//tools/format:format.check
//tools/format:format.check_Python_with_ruff
//tools/format:format.fix
//tools/format:format.fix.check
//tools/format:format.fix_Python_with_ruff
//tools/format:format.fix_Python_with_ruff.check

When I run: bazel run //tools/format:format.check_Python_with_ruff I get as suggestion the same command(check) instead of fix command:

FAILED: A formatter tool exited with code 123
Try running 'bazel run //tools/format:format.check_Python_with_ruff ' to fix this.

Version

Development (host) and target OS/architectures: Ubuntu 24.04

Output of bazel --version: bazel 7.4.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file: bazel_dep(name = "aspect_rules_lint", version = "1.0.3")

Language(s) and/or frameworks involved: python

How to reproduce

For 2 targets defined:


format_multirun(
    name = "format.fix",
    python = "@aspect_rules_lint//format:ruff",


and 


format_test(
    name = "format.check",
    python = "@aspect_rules_lint//format:ruff",


Run:
`bazel run //tools/format:format.check_Python_with_ruff`

Observed output:

FAILED: A formatter tool exited with code 123
Try running 'bazel run //tools/format:format.check_Python_with_ruff ' to fix this.


Expected output:

FAILED: A formatter tool exited with code 123
Try running 'bazel run //tools/format:format.fix_Python_with_ruff ' to fix this.

Any other information?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant