Using clang-tidy on C++ Code | Electron (2024)

clang-tidy is a tool toautomatically check C/C++/Objective-C code for style violations, programmingerrors, and best practices.

Electron's clang-tidy integration is provided as a linter script which canbe run with npm run lint:clang-tidy. While clang-tidy checks your on-diskfiles, you need to have built Electron so that it knows which compiler flagswere used. There is one required option for the script --output-dir, whichtells the script which build directory to pull the compilation informationfrom. A typical usage would be:npm run lint:clang-tidy --out-dir ../out/Testing

With no filenames provided, all C/C++/Objective-C files will be checked.You can provide a list of files to be checked by passing the filenames afterthe options:npm run lint:clang-tidy --out-dir ../out/Testing shell/browser/api/electron_api_app.cc

While clang-tidy has along listof possible checks, in Electron only a few are enabled by default. At themoment Electron doesn't have a .clang-tidy config, so clang-tidy willfind the one from Chromium at src/.clang-tidy and use the checks whichChromium has enabled. You can change which checks are run by using the--checks= option. This is passed straight through to clang-tidy, so seeits documentation for full details. Wildcards can be used, and checks canbe disabled by prefixing a -. By default any checks listed are added tothose in .clang-tidy, so if you'd like to limit the checks to specificones you should first exclude all checks then add back what you want, like--checks=-*,performance*.

Running clang-tidy is rather slow - internally it compiles each file andthen runs the checks so it will always be some factor slower than compilation.While you can use parallel runs to speed it up using the --jobs|-j option,clang-tidy also uses a lot of memory during its checks, so it can easilyrun into out-of-memory errors. As such the default number of jobs is one.

Using clang-tidy on C++ Code | Electron (2024)
Top Articles
Needs and Wants for Your Personal Budget
What Happens if You Miss a Class Action Lawsuit | Ankin Law
Splunk Stats Count By Hour
4-Hour Private ATV Riding Experience in Adirondacks 2024 on Cool Destinations
Guardians Of The Galaxy Showtimes Near Athol Cinemas 8
Coffman Memorial Union | U of M Bookstores
Truist Park Section 135
Lexington Herald-Leader from Lexington, Kentucky
Comcast Xfinity Outage in Kipton, Ohio
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
2022 Apple Trade P36
Xrarse
The Many Faces of the Craigslist Killer
Espn Expert Picks Week 2
Alaska Bücher in der richtigen Reihenfolge
Erin Kate Dolan Twitter
Cool Math Games Bucketball
18443168434
How Many Slices Are In A Large Pizza? | Number Of Pizzas To Order For Your Next Party
Nonne's Italian Restaurant And Sports Bar Port Orange Photos
Hijab Hookup Trendy
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis - NFL
Roll Out Gutter Extensions Lowe's
Scream Queens Parents Guide
How to Download and Play Ultra Panda on PC ?
Skycurve Replacement Mat
Poochies Liquor Store
Delta Township Bsa
Current Time In Maryland
Craigslist Free Stuff San Gabriel Valley
Of An Age Showtimes Near Alamo Drafthouse Sloans Lake
Jr Miss Naturist Pageant
Rocketpult Infinite Fuel
PA lawmakers push to restore Medicaid dental benefits for adults
Electronic Music Duo Daft Punk Announces Split After Nearly 3 Decades
Mid America Irish Dance Voy
Aurora Il Back Pages
Restored Republic June 6 2023
Tattoo Shops In Ocean City Nj
Lucifer Morningstar Wiki
Poe Self Chill
Spreading Unverified Info Crossword Clue
Tyco Forums
Page 5747 – Christianity Today
6463896344
Richard Mccroskey Crime Scene Photos
Is TinyZone TV Safe?
Call2Recycle Sites At The Home Depot
Samantha Lyne Wikipedia
M Life Insider
Myhrkohls.con
Latest Posts
Article information

Author: Ray Christiansen

Last Updated:

Views: 5952

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Ray Christiansen

Birthday: 1998-05-04

Address: Apt. 814 34339 Sauer Islands, Hirtheville, GA 02446-8771

Phone: +337636892828

Job: Lead Hospitality Designer

Hobby: Urban exploration, Tai chi, Lockpicking, Fashion, Gunsmithing, Pottery, Geocaching

Introduction: My name is Ray Christiansen, I am a fair, good, cute, gentle, vast, glamorous, excited person who loves writing and wants to share my knowledge and understanding with you.