I’ve inherited a javascript code base that has mixed space intentation widths. I’ve specified tab_size 4 and translate_tabs_to_spaces true in the project file, and I’d like to normalize everything to silence the linter, and do it all at once to avoid polluting the code history with whitespace changes.
For an individual file I have the following console commands that do the trick:
view.run_command("unexpand_tabs");view.run_command("set_setting", {"setting": "tab_size", "value": 4} );view.run_command("expand_tabs")
I’d like to do this programmatically across many files, not just the one open in the buffer. Is there a simple way to do this?
EDIT: I suppose I can just import os to iterate over files in a directory, so my specific question is how to do something like the run_command() above upon a file path instead of the current view.