Le 05/12/2018 à 00:22, Botond Ballo a écrit :
> Hi, I'd like to ask a couple of clarifications about process here: *
Is clang-format invoked automatically as part of a pre-commit hook, or
something like that?
We have been working on that. There is a pending patch
https://bugzilla.mozilla.org/show_bug.cgi?id=1507007
We will enable it as part of the ./mach bootstrap.
> * If not, should we be invoking it manually before submitting a patch?
Yes, I think this should be done as part of the developer workflows
now. Each developer’s local development environment is different but
we’re hoping that for many people this actually shouldn’t mean running
./mach clang-format manually. The recommended setup is to integrate
clang-format with your code editor using one of the integrations
documented here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style/Formatting_C++_Code_With_clang-format#Editor_Integrations
If you have tips to share about editor integrations, we’d appreciate
keeping that page updated!
And note that if you submit patches to Phabicator for review, a review
bot will automatically check your patches for formatting mistakes, and
if it detects them will provide a link to a patch that can be applied
locally to fix the issues.
> * If we submit a patch without having invoked it, will violations be
caught in automation? Will they trigger a backout?
We have been discussing about that. We don’t think we should backout a
C++ patch because of a missing space or line return and for now we
should focus on helping more developers update their local setup to run
clang-format as part of their local development workflow. Developing
local commit hooks, asking people to enable editor integrations and the
Phabricator review bot are efforts in this category.
In the meantime, we will be running a bot weekly to reformat the
mistakes and add the changeset into the ignore lists.
But in the long run this won’t be sustainable, so once we gain
confidence that a good number of developers have successfully integrated
clang-format into their local workflow, we will look into enabling a
Mercurial hook on hg.mozilla.org to reject misformatted code upon push
time. That will be the ultimate solution to help ensure that our code
will be properly formatted at all times.
Ehsan & Sylvestre
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform