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

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

Closed
wants to merge 3 commits into from

Conversation

rwstauner
Copy link
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?

@crccheck
Copy link

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)

as discussed in gh 174
json is often used in different cases than js.
@rwstauner
Copy link
Contributor Author

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).

@llimllib
Copy link

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

@rwstauner
Copy link
Contributor Author

Note that in the meantime you can put

--type-add=json=.json

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

@rwstauner
Copy link
Contributor Author

or

--type-add=js=.json

to avoid the warning about making a new type

@dolmen
Copy link
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
Copy link
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants