I created a script to perform an action on Cucumber Feature files (*.feature) in the on_pre_save callback, and I'm currently just checking the extension:
def on_pre_save(self, view):
file_name = view.file_name()
if not file_name: # buffer has never been saved
base_name, ext = os.path.splitext(file_name)
if ext != '.feature': # not a cucumber feature file
Is there a better way to restrict the callback to a particular type of file?