https://github.com/osquery/osquery logo
#core
Title
# core
s

seph

01/31/2020, 3:32 PM
I’d suggest we do several things: 1. Consider linting the whole files. This will produce larger diffs, but it will rip the bandaid off 2. Start fixing the linting everywhere, which will make that smoother 3. Provide a tool to either format the whole file, or run the diff and format it.
a

alessandrogario

01/31/2020, 3:39 PM
I think the original goal was to avoid changing lines that were not edited in the patch by formatting everything. This issue could be worked around by using -w when doing git blame/git log. The second problem is that sometimes a different version of clang-format could format things differently even though the config is the same (so whenever we upgrade the toolchain we risk having to reformat everything). I don't have any strong opinion on this. For reference, my workflow is the following one: 1. Make changes 2. Run clang-format 3. Run git add -p on the files I have changed and only confirm the chunks I edited
EDIT: Stefano made me realize -w is not enough, as clang-format can add new non-whitespace characters as well
8 Views