[all-commits] [llvm/llvm-project] fcf7cc: [clang-tidy] Added support for validating configur...

Nathan James via All-commits all-commits at lists.llvm.org
Tue Apr 7 11:54:40 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fcf7cc268fe4560bc7cd751494beceff45f5dd10
      https://github.com/llvm/llvm-project/commit/fcf7cc268fe4560bc7cd751494beceff45f5dd10
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
    M clang-tools-extra/clang-tidy/ClangTidyCheck.h
    M clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp

  Log Message:
  -----------
  [clang-tidy] Added support for validating configuration options

Summary:
Adds support for `ClangTidyCheck::OptionsView` to deteremine:
  - If an option is found in the configuration.
  - If an integer option read from configuration is parsable to an integer.
  - Parse and Serialize enum configuration options directly using a mapping from `llvm::StringRef` to `EnumType`.
  - If an integer or enum option isn't parseable but there is a default value it will issue a warning to stderr that the config value hasn't been used.
  - If an enum option isn't parsable it can provide a hint if the value was a typo.

Reviewers: aaron.ballman, alexfh, gribozavr2

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D77085




More information about the All-commits mailing list