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

using # noqa: flynt results in ruff warnings #197

Open
pschwaller opened this issue Jun 1, 2024 · 2 comments
Open

using # noqa: flynt results in ruff warnings #197

pschwaller opened this issue Jun 1, 2024 · 2 comments

Comments

@pschwaller
Copy link

I found a reference in the github issues to using "# noqa: flynt" to tell flynt not to process a particular line.

When I use that with the latest ruff, I get:
warning: Invalid # noqa directive

Is there an alternative that doesn't generate warnings?

@ikamensh
Copy link
Owner

ikamensh commented Aug 21, 2024

I can't reproduce the issue, what is the version of ruff you are using?

Furthermore, you could consider moving this issue to ruff repo. If this is reproducible on latest ruff, I'd say its ambitious of ruff to expect to know every other tool that might work with noqa directive.

@pschwaller
Copy link
Author

Reproduction steps:

    bar = "bar"
    foo = "asdf" + bar 

Flynt correctly complains. For whatever reason, I want flynt to ignore this, so I change it to:

    bar = "bar"
    foo = "asdf" + bar  # noqa: flynt

That quiets flynt.

ruff 0.4.8 complains with:
warning: Invalid # noqadirective on engine\pjs_sandbox.py:175: expected a comma-separated list of codes (e.g.,# noqa: F401, F841).

I'm not expecting ruff to know about the way flynt has chosen to overload the noqa directive. What I'm asking is whether there is an alternative method for flynt to turn itself off on a particular line -- one that doesn't overlap with the conventions used by other tools.

For example, for some messages mypy uses the standard noqa. But for others, I have to use # mypy: disable-error-code="xyz"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants