markbaas / atom-python-autopep8

MIT License
9 stars 6 forks source link

Suggestion: Code idea to handle Python files types in general #15

Open ghost opened 6 years ago

ghost commented 6 years ago

Hello.

May I suggest the line:

return editor.getGrammar().name.indexOf("Python",0) > 0

instead of.. https://github.com/markbaas/atom-python-autopep8/blob/master/lib/python-autopep8.coffee#L11

grammar = editor.getGrammar().name
return grammar == 'Python' or grammar == 'MagicPython'

My aim is to provide for more Python derivatives. (I added the line on an older version to adapt to MagicPython).

Thank you for your consideration.

ghost commented 6 years ago

As a side note.. my version remains at 0.13 and does not update to 0.14.