Page MenuHome

make format: add option to format only edited files.
ClosedPublic

Authored by Ankit Meel (ankitm) on Sep 23 2020, 2:39 PM.

Details

Summary

Inspired by [1].

Passing --changed-only will format uncommitted, edited files.

Passing --changed-only <path> will format uncommitted, edited files
lying on the <path>, i.e., it will usually narrow down the number
of files to be edited.

The long list of intern/* has been shortened since it is out of sync
with the current directory structure and adds a maintenance cost.

[1] https://github.com/llvm/llvm-project/blob/master/clang/tools/clang-format/git-clang-format

Diff Detail

Repository
rBDT Blender Dev Tools
Branch
optional_diff
Build Status
Buildable 10373
Build 10373: arc lint + arc unit

Event Timeline

Ankit Meel (ankitm) requested review of this revision.Sep 23 2020, 2:39 PM
  • pep8 compliance for the new code. Old code still violates E501 in a few places.

Thanks, committed rBDTb56014f295a23f314aa8fc902d599644cdc0fc39, with some minor edits.

utils_maintenance/clang_format_paths.py
38–57

I left out this part as it causes intern/itasc to be formatted.

If this is applied we should format all of intern as well.

Noting against this, just that it's outside the scope for this patch.

189

In this case adding the strings is simpler.

This revision is now accepted and ready to land.Sep 24 2020, 9:30 AM
utils_maintenance/clang_format_paths.py
38–57

Now the command --changed-only will error out, since "intern/string" doesn't exist which git diff will look for.