Infer spec type from file location, remove extra space