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

[Autofix error] Noqu remove in 0.0.256 #3666

Closed
Czaki opened this issue Mar 22, 2023 · 1 comment
Closed

[Autofix error] Noqu remove in 0.0.256 #3666

Czaki opened this issue Mar 22, 2023 · 1 comment
Labels
bug Something isn't working suppression Related to supression of violations e.g. noqa

Comments

@Czaki
Copy link
Contributor

Czaki commented Mar 22, 2023

When adding TRY rules in ruff configuration for napari project, then I add # noqa TRY301

        try:
            raise ValueError("a")  # noqa TRY301
        except ValueError:
            threading.excepthook(sys.exc_info())

Then in review there was a decision to skip TRY301 For all test files.

Then running ruff ends with:

error: Autofix introduced a syntax error. Reverting all changes.

This indicates a bug in `ruff`. If you could open an issue at:

    https://github.com/charliermarsh/ruff/issues/new?title=%5BAutofix%20error%5D

...quoting the contents of `napari/_qt/_tests/test_qt_notifications.py`, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!

Updating code to

        try:
            raise ValueError("a")  # noqa: TRY301
        except ValueError:
            threading.excepthook(sys.exc_info())

Makes auto-fix work.

It comes from the incorrect noqa # noqa TRY301 instead of # noqa: TRY301. But it looks like auto-fix should comment out the rest of the text if something is left after removing noqa

(in napari I introduce ruff in parts to make the review possible)

@charliermarsh
Copy link
Member

I believe this was fixed in #3589 (not yet released).

@charliermarsh charliermarsh added bug Something isn't working suppression Related to supression of violations e.g. noqa labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working suppression Related to supression of violations e.g. noqa
Projects
None yet
Development

No branches or pull requests

2 participants