Add and use python for formatting.#6298
Conversation
3ab309b to
af06225
Compare
|
This seems to work as far as I have tested with various changes in files, both with pre-commit and here in CI calling the same python script. |
| import subprocess | ||
| import argparse | ||
|
|
||
| WHITELIST = [ |
There was a problem hiding this comment.
Can we put these paths into a separate file (e.g. .dev/paths_to_format.txt) and then read that file both in format.py and format.sh? To avoid duplication
There was a problem hiding this comment.
I was actually thinking to remove the format.sh after a while, seeing that the python script performs as intended. So I could use the same list/file for both manual/ci formatting and for pre-commit.
We can do the split if you prefer to keep the format.sh and perhaps AI can help with the shell programming 😄
There was a problem hiding this comment.
I think I would prefer to keep format.sh for now. The shell command cat is probably sufficient to print the content of the file, so maybe local whitelist="${cat ${PCL_DIR}/.dev/paths_to_format.txt}"?
a18a512 to
329bb13
Compare
More cross platform than shell script.