-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from micksmix/master
Updated grammar updater, wrote a README, added Swift grammar, updated Kotlin grammar to v0.3.1
- Loading branch information
Showing
18 changed files
with
1,083,653 additions
and
522,185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,58 @@ | ||
.idea | ||
.idea | ||
|
||
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### macOS Patch ### | ||
# iCloud generated files | ||
*.icloud | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
.ionide | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Grammar Version Checker | ||
|
||
This Go program automates the process of checking and updating grammar versions for various programming languages. It targets specific grammars defined in a JSON configuration file and supports operations like checking for updates and performing updates. | ||
|
||
## Features | ||
|
||
- **Check for Updates**: Scan through defined grammars and check if there are new versions available. | ||
- **Update Grammar**: Update a specific grammar to its latest version. | ||
- **Update All**: Batch update all grammars to their latest versions. | ||
|
||
## Prerequisites | ||
|
||
- Go installed on your machine. | ||
- Git installed and accessible from your command line. | ||
|
||
## Configuration | ||
|
||
The program relies on a JSON file (`_automation/grammars.json`) for the list of grammars to manage. Each grammar should specify its `language`, `url`, `files`, `reference` (tag or branch), and `revision` (commit hash). | ||
|
||
Example structure of `grammars.json`: | ||
|
||
```json | ||
[ | ||
{ | ||
"language": "golang", | ||
"url": "https://github.com/tree-sitter/tree-sitter-go", | ||
"files": [ | ||
"parser.c" | ||
], | ||
"reference": "master", | ||
"revision": "64457ea6b73ef5422ed1687178d4545c3e91334a", | ||
"updatedBasedOn": "commit", //OPTIONAL: Use "tag" (instead of "commit") to restrict updates to the latest tag and not latest commit | ||
} | ||
] | ||
``` | ||
|
||
`updatedBasedOn` is an OPTIONAL property. If not provided, updating from the latest commit will be presumed. | ||
|
||
## Usage | ||
|
||
### To Check for Updates | ||
|
||
```bash | ||
go run ./_automation/main.go check-updates | ||
``` | ||
|
||
### To update a specific grammar | ||
```bash | ||
go run ./_automation/main.go update <language> [--force] | ||
``` | ||
|
||
### To update all grammars | ||
```bash | ||
go run ./_automation/main.go update-all | ||
``` | ||
|
||
## Test After Updating | ||
Once you've updated a grammar, it is important to test that the binding tests still pass (`binding_test.go`). Then run: | ||
|
||
```bash | ||
go test -v ./... | ||
``` |
Oops, something went wrong.