GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.29k stars 385 forks source link

Update Git Attributes for JSON syntax highlighting in `*.graphite` files #1752

Closed spenserblack closed 1 month ago

spenserblack commented 1 month ago

This is just the type of small PR that I always compulsively do when I encounter a project with a new filetype :laughing:

This will apply the JSON syntax highlighting to some *.graphite files on GitHub (syntax highlighting is disabled for large minified files). It marks most *.graphite files as binary and generated, hiding diffs locally and in GitHub PRs. It reverts this for the graphite test files, since they seem to be manually written.

Currently, whether or not syntax highlighting is applied to test_files/*.graphite seems to almost be random (linguist's Bayesian classifer timing out perhaps :shrug:), but you can see in my fork that syntax highlighting is always applied.

Keavon commented 1 month ago

This is neat, thanks! I'd never have known about this.

You mention that your fork's repo files show the JSON syntax highlighting but when I navigate to https://github.com/spenserblack/Graphite/blob/master/demo-artwork/isometric-fountain.graphite I don't see syntax highlighting. Did you mean somewhere else or something?

spenserblack commented 1 month ago

You mention that your fork's repo files show the JSON syntax highlighting but when I navigate to https://github.com/spenserblack/Graphite/blob/master/demo-artwork/isometric-fountain.graphite I don't see syntax highlighting. Did you mean somewhere else or something?

Yeah, I was referring to the test files. Unfortunately, because the "real" Graphite files resemble minified JSON, I don't believe they will get syntax highlighting, except possibly for very small files. So I think this is mostly helpful for development/debugging.

Keavon commented 1 month ago

I see, makes sense! Thanks for this contribution.