First time here? Check out the FAQ!

Revision history  [back]

I think this is due to ${WING:FILENAME} being empty if there is not file at the current focus. That's somewhat of a surprise, in that I thought it was supposed to use current editor regardless of focus. May be a bug and we'll look into it.

However, you can use Ruff with Wing's Code Warnings tool, which would likely be a lot more convenient. Bring up the Code Warnings tool from the Tools menu, change to Configuration: Defaults in the drop down at the top, check on Enable External Checkers and then press Configure next to that to enable Ruff. The default configuration assumes Ruff is installed into the Python env being used by your project. If not, you can change the command line Wing uses.

After that Ruff warnings are included in the Code Warnings tool and warnings drop down at top of the editor, and the location of warnings are indicated on the source code. If you disable a warning, it disables the whole class of warnings as in the --ignore argument, so it's pretty quick to get down to just the warnings that you want, although you can also change the command line in the Ruff config in the Code Warnings tool if you want.