Add 'json' to the list of extensions for 'js' #174

Closed
wants to merge 3 commits into
from

Projects

None yet

5 participants

Contributor

I was grepping in the directory of an extracted CPAN distribution
for module dependencies and noticed that META.yml had a hit while META.json didn't show up.

I almost made json it's own type, then thought maybe it should just be in with the 'js'...
Any thoughts on the matter?
Or perhaps have you specifically left json out for a reason?

My first thought is that json would be its own. Five examples:

  • JSON files usually don't have line breaks
  • yaml is its own type
  • say you have a JSON that's some sort of massive dictionary. Imagine searching for a variable name in your JS file.

(there's a Monty Python joke in here somewhere)

Contributor

yeah I thought of those too...
guess I should have trusted my first instinct.

I see now that ack and ack-help-types.txt have been modified (didn't notice it last time... maybe I didn't "make" it right).

+1, either as its own type, or as part of js

Contributor

Note that in the meantime you can put

--type-add=json=.json

in your ~/.ackrc to include .json files in searches

Contributor

or

--type-add=js=.json

to avoid the warning about making a new type

Contributor
dolmen commented Nov 19, 2011

@rwstauner To define a new type, use --type-set instead of --type-add:

--type-set json=.json

https://metacpan.org/module/ack#Defining-your-own-types

@hoelzro hoelzro referenced this pull request in petdance/ack2 Aug 28, 2013
Merged

Add JSON filetype #285

Collaborator
hoelzro commented Aug 28, 2013

This made it into ack2, so closing!

@hoelzro hoelzro closed this Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment