New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 876875 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature



Sign in to add a comment

clang-format repohook: improve cwd handling

Project Member Reported by norvez@chromium.org, Aug 22

Issue description

I 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
 
Running '/usr/local/google/home/norvez/chromeos/src/repohooks/clang-format.py --debug --fix --commit 06a5c5fcc' did succeed. Removing the list of directories apparently makes a difference?
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.
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?
Cc: lhchavez@chromium.org
Labels: -Type-Bug -Pri-2 Hotlist-GoodFirstBug Pri-3 Type-Feature
Status: Available (was: Unconfirmed)
Summary: clang-format repohook: improve cwd handling (was: clang-format on platform2 fails but doesn't report why in presubmit)
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