Improve the error message when the clang-format isn't correct
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Tracking
(firefox68 fixed)
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: keeler, Assigned: andi)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
A couple of times I've seen this error after using hg rebase
or hg backout
:
Processing 1 file(s)...
YAML:28:19: error: unknown key 'StatementMacros'
StatementMacros: [MARKUPMAP, ASSERT_TRUE, ASSERT_FALSE, TEST, CHECK]
^
Error reading /home/keeler/mozilla-unified/.clang-format: Invalid argument
The error occurred in the implementation of the invoked mach command.
This should never occur and is likely a bug in the implementation of that
command. Consider filing a bug for this issue.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
AssertionError
File "/home/keeler/mozilla-unified/python/mach/mach/main.py", line 524, in _run
**vars(args.command_args))
File "/home/keeler/mozilla-unified/python/mach/mach/registrar.py", line 101, in _run_command_handler
assert isinstance(result, (int, long))
Comment 1•5 years ago
|
||
Please run mach boostrap to update the version of clang-format
(until you do, just comment the last line of .clang-format)
Updated•5 years ago
|
Reporter | ||
Comment 2•5 years ago
|
||
Ah, that did it. Thanks!
Comment 3•5 years ago
|
||
I had the same problem yesterday, and I think something should be done to make things more obvious.
Comment 4•5 years ago
|
||
We are checking the version of clang-tidy, we should probably do the same with clang-format.
(we could just add the version in .clang-format as a comment)
Andi, could take the lead on that? Thanks
Assignee | ||
Comment 5•5 years ago
|
||
Sure this is a good idea, but since clang-tidy
and clang-format
are shipped together hence they are bounded in the same package I would suggest using this version tracker: https://searchfox.org/mozilla-central/source/tools/clang-tidy/config.yaml#21
Assignee | ||
Updated•5 years ago
|
Comment 6•5 years ago
|
||
this might add some confusion, this is why I didn't suggested it but why not :)
Please rename the field in config.yaml
Assignee | ||
Comment 7•5 years ago
|
||
Sure, the actual name will only cause confusion. But the field has been added in this revision but without any extra implementation that can leverage it: https://hg.mozilla.org/mozilla-central/rev/4c43aecaddf8
Assignee | ||
Comment 8•5 years ago
|
||
Pushed by bpostelnicu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bc17715cc318 for clang based static-analysis and formating add a package version that represents a baseline if we continue the analysis or prompt for an update. r=sylvestre
Comment 10•5 years ago
|
||
bugherder |
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•