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

Updated grammar updater, wrote a README, added Swift grammar, updated Kotlin grammar to v0.3.1 #145

Merged
merged 10 commits into from
Mar 20, 2024

Conversation

micksmix
Copy link
Contributor

@micksmix micksmix commented Feb 8, 2024

  1. updated _automation/main.go script to prefer commits tied to a latest release, if it exists. If a grammar repository includes a Release, this updater now prioritizes updating to the latest release rather than the most recent commit. In cases where the repository lacks releases, it defaults to using the latest commit.
  2. Added a README.md for the updater
  3. Added a subcommand called run-tests which will run go test against every grammar's binding_test.go file
  4. Updated Kotlin grammar to latest release (v0.3.1)
  5. Updated .gitignore file to ignore VSCode and macOS related files that shouldn't be committed

micksmix and others added 4 commits February 7, 2024 19:31
… release, if it exists. Added a README.md for this file. Added a subcommand called 'run-tests' which will run 'go test' against every grammar's 'binding_test.go' file.
@micksmix
Copy link
Contributor Author

micksmix commented Feb 8, 2024

updated _automation/main.go script to prefer commits tied to a latest release, if it exists. If a grammar repository includes a Release, this updater now prioritizes updating to the latest release rather than the most recent commit. In cases where the repository lacks releases, it defaults to using the latest commit.

For background, the reason I added this is because the kotlin grammar's most recent commit actually is a failing build. However, that project cuts releases and by grabbing the commit for the latest release, it builds correctly.

…n of Swift grammer from github.com/alex-pinkus/tree-sitter-swift
@micksmix
Copy link
Contributor Author

micksmix commented Feb 9, 2024

I added more to this PR.

I also added the Swift grammar for Apple's Swift programming language. I had to add a downloadSwift function to the automation updater to support retrieving this grammar...which doesn't include parser.c in the repo, but instead in zip file in a release.

@micksmix micksmix changed the title Updated grammar updater, wrote a README, updated Kotlin grammar to v0.3.1 Updated grammar updater, wrote a README, added Swift grammar, updated Kotlin grammar to v0.3.1 Feb 9, 2024
@micksmix
Copy link
Contributor Author

micksmix commented Feb 9, 2024

@smacker - Please let me know if you'd like me to make any changes, or split into separate PR's.

_automation/main.go Outdated Show resolved Hide resolved
_automation/main.go Outdated Show resolved Hide resolved
_automation/main.go Outdated Show resolved Hide resolved
_automation/main.go Outdated Show resolved Hide resolved
@micksmix
Copy link
Contributor Author

@smacker Based on your feedback, I have greatly simplified my PR. I've added the optional updateBasedOn property. If it's not provided, it is presumed to be commit. If a user does provide "updatedBasedOn": "tag", then it will call fetchLastTag.

With these changes, I no longer need a custom downloadSwift function or any other additional functions.

This is a much simpler PR now with fewer changes. Thanks for your review.

@micksmix
Copy link
Contributor Author

@smacker - Do you want changes to this to this PR or would you like me to re-architect this?

_automation/grammars.json Outdated Show resolved Hide resolved
_automation/main.go Outdated Show resolved Hide resolved
@smacker
Copy link
Owner

smacker commented Mar 18, 2024

@micksmix Weird. I remember leaving comments here but I don't see them now...
Anyway, PR looks great! Thank you.

I just added 2 small comments to ensure the behavior of the updater is consistent and straightforward.

@micksmix
Copy link
Contributor Author

Changes that @smacker suggested have been made. Ran go test -v ./... and all tests passed. Kotlin grammar is at v0.3.5

@smacker smacker merged commit a4b649a into smacker:master Mar 20, 2024
4 checks passed
@smacker
Copy link
Owner

smacker commented Mar 20, 2024

Thank you so much!

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

Successfully merging this pull request may close these issues.

None yet

3 participants