identify icon indicating copy to clipboard operation
identify copied to clipboard

salt sls files with python shebangs are not properly recognized

Open raddessi opened this issue 7 years ago • 2 comments

Some salt sls files are written in python directly, I've added those interpreters in a PR here https://github.com/chriskuehl/identify/pull/60 as well as disabled the executable checks since these files are not required to be and also disabled the optimization for skipping peeking at the file contents if we recognize the extension.. I do see how this a nice speedup though.. maybe the extensions.EXTENSIONS dict should be changed from:

EXTENSIONS = {
...
    'sh': {'text', 'shell'},
    'sls': {'text', 'salt'},
    'so': {'binary'},
...
}

to something like:

EXTENSIONS = {
...
    'sh': {
        'tags': {'text', 'shell'},
        },
    'sls': {
        'tags': {'text', 'salt'},
        'always-peek': True,
    },
    'so': {
        'tags': {'binary'},
    },
...
}

By changing each value to its own dict which could have an optional key always-peek(?) so then you could .get('always-peek', False) to check if the file should be inspected?

raddessi avatar Nov 09 '18 05:11 raddessi

Hmm, let me fix those failing unit tests first..

raddessi avatar Nov 09 '18 17:11 raddessi

Should be happy now :)

raddessi avatar Nov 09 '18 17:11 raddessi