Use the list provided by .clang-format-ignore instead of only thirdpartypath.txt

RESOLVED FIXED in Firefox 57

Status

RESOLVED FIXED
a year ago
8 months ago

People

(Reporter: sylvestre, Assigned: sylvestre)

Tracking

(Blocks: 1 bug)

Trunk
mozilla57

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

a year ago
The thirdparty list only contains thirdparty code but we also want to ignore some of our code.

As .clang-format-ignore also contains the content of thirdparthpath.txt, let's us this one (especially as we can use regexp now)
Comment hidden (mozreview-request)
(Assignee)

Comment 2

a year ago
As an example:
$ ./mach clang-format -p dom/presentation/ toolkit/components/protobuf/  config/gcc-stl-wrapper.template.h
clang-format: Ignored third party code 'toolkit/components/protobuf/'
clang-format: Ignored third party code 'config/gcc-stl-wrapper.template.h'

I landed this patch upstream:
https://reviews.llvm.org/rL310778
to have a better display in the tool
Comment hidden (mozreview-request)
(Assignee)

Comment 4

a year ago
The ignore list will be also used when doing
./mach clang-format -p .

Comment 5

a year ago
mozreview-review
Comment on attachment 8898271 [details]
Bug 1391231 - Use the list provided by .clang-format-ignore instead of only thirdpartypath.txt

https://reviewboard.mozilla.org/r/169636/#review175392

FWIW, the use of regular expressions for path matching as employed by ``.clang-ignore-patterns`` and used in this file hits scaling limits. I know because Mercurial has dealt with this problem on several fronts. glob based matching (using ``*``) to denote wildcards is much better (especially if you can limit the wildcard to only occurring at the end of the string). I'm not sure if this will be a problem for us. But it is worth mentioning just so it is on your radar.

::: tools/mach_commands.py:293
(Diff revision 2)
> +        ignored_dir_re = '(%s)' % '|'.join(ignored_dir)
>          extensions = ('.cpp', '.c', '.h')
>  
>          path_list = []
>          for f in paths:
> -            if f.startswith(ignored_dir):
> +            import re

You can move this to module level: this module is already imported elsewhere.
Attachment #8898271 - Flags: review?(gps) → review+
Comment hidden (mozreview-request)

Comment 7

a year ago
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b6c847346cb6
Use the list provided by .clang-format-ignore instead of only thirdpartypath.txt r=gps

Comment 8

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b6c847346cb6
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox57: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
(Assignee)

Updated

9 months ago
Duplicate of this bug: 1234864

Updated

8 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.