Skip to content

Plugin format command fails when clang-format is from chromium #117195

@jmagman

Description

@jmagman

Those of us who have develop the engine on our machines often have chromium's depot_tools on our PATH for gclient etc.
So the first clang-format the plugin format command tries to use is chromium/depot_tools/clang-format, which fails when run:

Problem while looking for clang-format in Chromium source tree:
File does not exist: /Users/magder/Projects/chromium/buildtools/mac/clang-forma

This means the plugin format command dart pub global run flutter_plugin_tools format always fails with a confusing error:

Unable to run "clang-format". Make sure that it is in your path, or provide a full path with --clang-format.

This isn't the plugin tool's fault that chromium's clang-format fails, but 3 people on my team have hit this, including me.

Suggest when clang-format fails, continue trying with all the executables found in the user path (which -a).

Metadata

Metadata

Assignees

Labels

p: toolingAffects the flutter_plugin_tools packagepackageflutter/packages repository. See also p: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions