clang-tidy – Clang-based C and C++ linter

clang-tidy is a static analysis and linting tool for C and C++ developed as part of the LLVM project. It identifies potential programming errors, coding style violations and opportunities to improve source code using modern language features.

The application builds on Clang’s parsing and semantic analysis capabilities. Its checks cover categories such as bug-prone constructs, performance problems, readability issues, portability and compliance with established coding guidelines.

clang-tidy can also suggest or automatically apply corrections for many detected problems. Developers can select the checks appropriate to their project and integrate the tool into their existing build systems and continuous integration workflows.

This is free and open source software.

Key Features

  • Static analysis of C and C++ source code using Clang’s compiler infrastructure.
  • Detect potential bugs, suspicious constructs and incorrect API usage.
  • Identify performance problems and unnecessary operations.
  • Suggest modern C++ language features and programming practices.
  • Readability checks covering naming conventions, code structure and maintainability.
  • Support for coding guidelines including the C++ Core Guidelines and CERT.
  • Run selected checks from Clang Static Analyzer.
  • Modular architecture allowing developers to implement custom checks.
  • Enable or disable checks through command-line options and configuration files.
  • Project-specific configuration using .clang-tidy files.
  • Automatic fixes for many supported diagnostics.
  • Export suggested changes in YAML format for later application.
  • Use compilation databases to obtain project build settings.
  • Analyse selected files and filter diagnostics by source location.
  • Integrate with editors, development environments and continuous integration systems.
  • Treat selected warnings as errors to enforce project coding standards.

Website: clang.llvm.org/extra/clang-tidy
Support:
Developer: LLVM Project
License: Apache License 2.0 with LLVM Exceptions

clang-tidy is written in C++. Learn C++ with our recommended free books and free tutorials.


Related Software

C and C++ Linters
OCLintStatic code analysis tool for improving quality and reducing defects
cpplintStatic code checker for C++
CodeCheckerPlatform for running static analysers and managing code defects
UncrustifySource code beautifer
InferStatic analyser that detects bugs in Java, C and C++ code
Include What You UseSource analysis tool for C and C++ projects built on Clang
CppcheckStatic analysis tool for C/C++ code
flawfinderScans C and C++ source code for potential security weaknesses
clazyQt-focused static analyser that catches common C++ mistakes
ClangFormatCode formatting tool
Clang-TidyClang-based C++ “linter” tool
SmatchStatic analysis tool for finding defects in C code
CoccinelleSemantic patching tool for analysing and transforming C code

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted