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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 13, 2024

Conversation

spenserblack
Copy link
Contributor

@spenserblack spenserblack commented May 13, 2024

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

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 馃し), but you can see in my fork that syntax highlighting is always applied.

Adds syntax highlighting on GitHub and treats the files as generated/binary.
@Keavon
Copy link
Member

Keavon commented May 13, 2024

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
Copy link
Contributor Author

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
Copy link
Member

Keavon commented May 13, 2024

I see, makes sense! Thanks for this contribution.

@Keavon Keavon changed the title Update Git Attributes for *.graphite Update Git Attributes for JSON syntax highlighting in *.graphite files May 13, 2024
@Keavon Keavon enabled auto-merge (squash) May 13, 2024 22:29
@Keavon Keavon merged commit 377b897 into GraphiteEditor:master May 13, 2024
2 checks passed
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

2 participants