relastle / vim-nayvy

:new_moon: Enriching python coding in Vim :snake:
MIT License
66 stars 4 forks source link

[feature]: Auto typing #18

Open aemonge opened 1 month ago

aemonge commented 1 month ago

Why not also include an auto-typing generation? pyright usually detects typing pretty well, and inlay hints it too, but there is nothing that I've seen to add types automatically.

making:

def hello():
  pass

to

def hello() -> None:
  pass

With pyright hints, is extremely useful.

relastle commented 1 month ago

@aemonge The reason why the feature is not included is that the core concept of this plugins is to minimize the effort of importing or of removing import of python scripts.

However, is this need is a very general one, I might consier it developed. Is there any linter that suggest

def hello():
    pass

to

def hello() -> None:
    pass

in this way?

Since this plugins fixes the code automatically with the aid of existing linter's output (such as ruff, pyflakes and etc), automatic fixed like the above would be impossible if there is no such linter.