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

Better types and minor refactor/cleanup #850

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

TheLeoP
Copy link
Contributor

@TheLeoP TheLeoP commented Feb 6, 2025

Describe what this PR does / why we need it

I want to contribute more to the codebase, but it's a bit daunting without knowing it. Type annotations make it easier and more manageable. But, A lot of the types come from the Github API, so I also added a script to generate them from the Graphlq schema definition (and a the generated file). I didn't know Github also had a REST API before this PR, so those types may need to wait for now :p

Does this pull request fix one issue?

NONE

Describe how you did it

Used the Grahpql specificacion to generate LuaCAT annotations for the Github Grapgql schema. I used those types to better type (and caught a couple of error while doing it) some parts of the codebase

Describe how to verify it

I think I shouldn't have change the behavior of the plugin, but something may have slipped through my refactors. I guess the test should catch it if it happened

Special notes for reviews

Ignore the huge line count, it's mostly because of the huge generate file with the type definitions.

The script on scripts/generate_gh_types.lua needs to be run from within Neovim by doing :source with that file opened. It'll generate the file ./lua/octo/_meta/gh.lua

Checklist

  • Passing tests and linting standards
  • Documentation updates in README.md and doc/octo.txt

@wd60622 wd60622 added maintenance documentation Improvements or additions to documentation and removed maintenance labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants