nova-python / Python.novaextension

Python for Nova
MIT License
11 stars 1 forks source link

Cannot disable "x is not accessed" warnings #5

Closed samdoran closed 5 months ago

samdoran commented 5 months ago

Thanks for making this extension. It's great! I was able to replace several extensions with this one. I only ran into one minor issue.

Unaccessed variables and imports are shown in the Issues panel even though running pyright on the command line shows no issues. I have tried various pyright settings in the pyproject.toml file but none of them disabled these findings.

Here is a simple file to show the issue:

#!/usr/bin/env python

def myfunc(arg):
    return
Screenshot 2024-04-03 at 15 06 46

I tried adding # pyright: ignore to the line and that had no affect.

Command line output:

> pyright example.py
0 errors, 0 warnings, 0 informations

Some system information:

> pyright --version
pyright 1.1.357

> sw_vers
ProductName:        macOS
ProductVersion:     14.4.1
BuildVersion:       23E224

> nova --version
11.9
dcwatson commented 5 months ago

These are actually diagnostic hints, which up until recently Pyright has claimed that being able to disable is not necessary and should be the job of the client. However, I just had another look and found that they finally added a way!

https://github.com/microsoft/pyright/issues/1118#issuecomment-1893295993

I've verified that I can add a setting to the extension that will disable these, so I'll get an update out in the next day or so. I've also filed a feature request for Nova to be able to filter the issues sidebar. 🤞 for 12.0.

dcwatson commented 5 months ago

Just pushed out version 1.2.1 with the new setting - give it a shot!

samdoran commented 5 months ago

Just updated and it works great! Thanks for finding that setting. I read through all the settings in the docs yesterday and there's no mention of that for the CLI options.

I was going to ask for a new release since the ruff --output-format option changed and I saw you had fixed that months ago. I was running from source but now I don't need to do that anymore.

Thanks again! This extension is great. I'll open issues/PRs if there's anything else I run into in the future.