Closed Bug 1766038 Opened 3 years ago Closed 2 years ago

Implement a linter to prefer full template over typedefs for JS::Handle/Rooted.

Categories

(Developer Infrastructure :: Source Code Analysis, enhancement)

enhancement

Tracking

(firefox102 fixed)

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: saschanaz, Assigned: saschanaz)

References

(Regressed 1 open bug)

Details

Attachments

(1 file)

It's currently quite mixed everywhere. We need to make it consistent.

Type: defect → enhancement

Could you detail this with an example please?

Flags: needinfo?(krosylight)
Assignee: nobody → krosylight
Attachment #9275528 - Attachment description: WIP: Bug 1766038 - Prefer full qualified types over typedefs for JS::Handle/Rooted → Bug 1766038 - Prefer full qualified types over typedefs for JS::Handle/Rooted r=sfink,andi!
Status: NEW → ASSIGNED

I hope the attachment provides the details.

It works with --enable-clang-plugin but ./mach static-analysis check --fix does not include the new checker. It seems the command uses the prebuilt one, can I tell it to use the in-source one to try the autofix?

Flags: needinfo?(krosylight) → needinfo?(bpostelnicu)

I think you can use: https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code_analysis/mach_commands.py#1025
You can build clang-tidy on try download he artifact and use that one.

Flags: needinfo?(bpostelnicu)

Thanks, triggering toolchain-win64-clang-tidy helped (which is only available with "Use full job list") and ./mach static-analysis install C:\Users\sasch\Downloads\clang-tidy.tar.zst (which somehow failed to unzip at the first try but worked at repeated tries. It just unzips things to ./mozbuild/clang-tools/, though.)

Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cfcc7c859257 Prefer full qualified types over typedefs for JS::Handle/Rooted r=andi,sfink
Pushed by imoraru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/01bec52b2ba3 fix black lint failures on moz.build. r=fix CLOSED TREE
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b2c676c92d7f Prefer full qualified types over typedefs for JS::Handle/Rooted r=andi,sfink
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
Flags: needinfo?(krosylight)

The too many warnings hide compile errors from my eyes...

Oh, and if there are too many warnings in the rebuild sources, the compile errors may be discarded from the buffer of the terminal.

Bug 1769494 will reduce a lot of them, sorry for the inconvenience 😞

I think that you could've landed the patch for this bug with some silencer patches which reduce the warnings enough. I hope you'd do that at next time you do something similar.

Regressions: 1770758
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: