clang-format repohook: improve cwd handling |
||
Issue descriptionI was trying to 'repo upload' https://chromium-review.googlesource.com/c/chromiumos/platform2/+/1185848 But the presubmit would fail in clang-format: " Errors: * clang-format.py errors/warnings The following files have formatting errors: biod/cros_fp_biometrics_manager.cc You can run `/usr/local/google/home/norvez/chromeos/src/repohooks/clang-format.py --fix arc/ authpolicy/ biod/ bluetooth/ buffet/ cfm-device-updater/ crash-reporter/ cros-disks/ crosdns/ diagnostics/ dlcservice/ goldfishd/ installer/ libchromeos-ui/ libcontainer/ libpasswordprovider/ login_manager/ mist/ modemfwd/ oobe_config/ portier/ power_manager/ run_oci/ smbprovider/ vm_tools/ vpn-manager/ wimax_manager/ --commit 06a5c5fcc15f41d6c318fbd035c733e406b7fffe` to fix this " But running the recommended command doesn't do anything, the format is still not valid. So we're left with no real way to fix this but to upload with --no-verify
,
Aug 22
my guess is your cwd isn't the top of platform2. that's where the tool expects to run. we covered this in issue 840079, but we can make this into a dedicated bug on the topic if that is what you're seeing.
,
Aug 22
Ah yes, that's what happening, thanks! We can mark this one as dupe. Maybe the error message could explain that the command needs to be run from the top of platform2?
,
Aug 22
nah, lets keep them separate. that bug was more of a meandering discussion with multiple things. we can focus this on the cwd aspect in case someone wants to pick it up. |
||
►
Sign in to add a comment |
||
Comment 1 by norvez@chromium.org
, Aug 22