[clang-tidy] Organize check doc files into subdirectories (NFC)
- Rename doc files to subdirs by module - Update release notes and check list to use subdirs - Update add_new_check.py to handle doc subdirs Differential Revision: https://reviews.llvm.org/D126495
This commit is contained in:
@@ -20,7 +20,7 @@ namespace abseil {
|
||||
/// deduction (CTAD), in C++17 and higher.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-cleanup-ctad.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/cleanup-ctad.html
|
||||
class CleanupCtadCheck : public utils::TransformerClangTidyCheck {
|
||||
public:
|
||||
CleanupCtadCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// ``absl::Time`` domain.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-addition.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-addition.html
|
||||
class DurationAdditionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DurationAdditionCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// domain.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-comparison.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-comparison.html
|
||||
class DurationComparisonCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DurationComparisonCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// the right conversion function instead.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-conversion-cast.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-conversion-cast.html
|
||||
class DurationConversionCastCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DurationConversionCastCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace abseil {
|
||||
// Find potential incorrect uses of integer division of absl::Duration objects.
|
||||
//
|
||||
// For the user-facing documentation see:
|
||||
// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-division.html
|
||||
// http://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-division.html
|
||||
|
||||
class DurationDivisionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace abseil {
|
||||
/// component.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-factory-float.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-factory-float.html
|
||||
class DurationFactoryFloatCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DurationFactoryFloatCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace abseil {
|
||||
/// case of zero and suggests `ZeroDuration()`.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-factory-scale.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-factory-scale.html
|
||||
class DurationFactoryScaleCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DurationFactoryScaleCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// `absl::Duration` domain.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-subtraction.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-subtraction.html
|
||||
class DurationSubtractionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DurationSubtractionCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// to numeric types and back again.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-unnecessary-conversion.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/duration-unnecessary-conversion.html
|
||||
class DurationUnnecessaryConversionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DurationUnnecessaryConversionCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// is a single character string literal and replaces it with a character.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-faster-strsplit-delimiter.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/faster-strsplit-delimiter.html
|
||||
class FasterStrsplitDelimiterCheck : public ClangTidyCheck {
|
||||
public:
|
||||
FasterStrsplitDelimiterCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// against doing so.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-no-internal-dependencies.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/no-internal-dependencies.html
|
||||
class NoInternalDependenciesCheck : public ClangTidyCheck {
|
||||
public:
|
||||
NoInternalDependenciesCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// Abseil's compatibility guidelines.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-no-namespace.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/no-namespace.html
|
||||
class NoNamespaceCheck : public ClangTidyCheck {
|
||||
public:
|
||||
NoNamespaceCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace abseil {
|
||||
/// StrCat(1, StrCat(2, 3)) ==> StrCat(1, 2, 3)
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-redundant-strcat-calls.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/redundant-strcat-calls.html
|
||||
class RedundantStrcatCallsCheck : public ClangTidyCheck {
|
||||
public:
|
||||
RedundantStrcatCallsCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// should be used instead.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-str-cat-append.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/str-cat-append.html
|
||||
class StrCatAppendCheck : public ClangTidyCheck {
|
||||
public:
|
||||
StrCatAppendCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace abseil {
|
||||
/// types) and suggests replacing with absl::StrContains.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-string-find-str-contains.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/string-find-str-contains.html
|
||||
class StringFindStrContainsCheck : public utils::TransformerClangTidyCheck {
|
||||
public:
|
||||
StringFindStrContainsCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// domain.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-time-comparison.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/time-comparison.html
|
||||
class TimeComparisonCheck : public ClangTidyCheck {
|
||||
public:
|
||||
TimeComparisonCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace abseil {
|
||||
/// in the time domain instead of the numeric domain.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-time-subtraction.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/time-subtraction.html
|
||||
class TimeSubtractionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
TimeSubtractionCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace abseil {
|
||||
/// Finds deprecated uses of `absl::Duration` arithmetic operators and factories.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil-upgrade-duration-conversions.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/abseil/upgrade-duration-conversions.html
|
||||
class UpgradeDurationConversionsCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UpgradeDurationConversionsCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -54,7 +54,6 @@ def adapt_cmake(module_path, check_name_camel):
|
||||
|
||||
# Adds a header for the new check.
|
||||
def write_header(module_path, module, namespace, check_name, check_name_camel):
|
||||
check_name_dashes = module + '-' + check_name
|
||||
filename = os.path.join(module_path, check_name_camel) + '.h'
|
||||
print('Creating %s...' % filename)
|
||||
with io.open(filename, 'w', encoding='utf8', newline='\n') as f:
|
||||
@@ -85,10 +84,10 @@ namespace %(namespace)s {
|
||||
/// FIXME: Write a short description.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/%(check_name_dashes)s.html
|
||||
class %(check_name)s : public ClangTidyCheck {
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/%(module)s/%(check_name)s.html
|
||||
class %(check_name_camel)s : public ClangTidyCheck {
|
||||
public:
|
||||
%(check_name)s(StringRef Name, ClangTidyContext *Context)
|
||||
%(check_name_camel)s(StringRef Name, ClangTidyContext *Context)
|
||||
: ClangTidyCheck(Name, Context) {}
|
||||
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
|
||||
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
|
||||
@@ -100,8 +99,8 @@ public:
|
||||
|
||||
#endif // %(header_guard)s
|
||||
""" % {'header_guard': header_guard,
|
||||
'check_name': check_name_camel,
|
||||
'check_name_dashes': check_name_dashes,
|
||||
'check_name_camel': check_name_camel,
|
||||
'check_name': check_name,
|
||||
'module': module,
|
||||
'namespace': namespace})
|
||||
|
||||
@@ -266,11 +265,11 @@ def add_release_notes(module_path, module, check_name):
|
||||
if header_found and add_note_here:
|
||||
if not line.startswith('^^^^'):
|
||||
f.write("""- New :doc:`%s
|
||||
<clang-tidy/checks/%s>` check.
|
||||
<clang-tidy/checks/%s/%s>` check.
|
||||
|
||||
FIXME: add release notes.
|
||||
|
||||
""" % (check_name_dashes, check_name_dashes))
|
||||
""" % (check_name_dashes, module, check_name))
|
||||
note_added = True
|
||||
|
||||
f.write(line)
|
||||
@@ -321,8 +320,11 @@ def update_checks_list(clang_tidy_path):
|
||||
with io.open(filename, 'r', encoding='utf8') as f:
|
||||
lines = f.readlines()
|
||||
# Get all existing docs
|
||||
doc_files = list(filter(lambda s: s.endswith('.rst') and s != 'list.rst',
|
||||
os.listdir(docs_dir)))
|
||||
doc_files = []
|
||||
for subdir in list(filter(lambda s: not s.endswith('.rst') and not s.endswith('.py'),
|
||||
os.listdir(docs_dir))):
|
||||
for file in filter(lambda s: s.endswith('.rst'), os.listdir(os.path.join(docs_dir, subdir))):
|
||||
doc_files.append([subdir, file])
|
||||
doc_files.sort()
|
||||
|
||||
# We couldn't find the source file from the check name, so try to find the
|
||||
@@ -422,9 +424,9 @@ def update_checks_list(clang_tidy_path):
|
||||
return ''
|
||||
|
||||
def process_doc(doc_file):
|
||||
check_name = doc_file.replace('.rst', '')
|
||||
check_name = doc_file[0] + '-' + doc_file[1].replace('.rst', '')
|
||||
|
||||
with io.open(os.path.join(docs_dir, doc_file), 'r', encoding='utf8') as doc:
|
||||
with io.open(os.path.join(docs_dir, *doc_file), 'r', encoding='utf8') as doc:
|
||||
content = doc.read()
|
||||
match = re.search('.*:orphan:.*', content)
|
||||
|
||||
@@ -432,7 +434,7 @@ def update_checks_list(clang_tidy_path):
|
||||
# Orphan page, don't list it.
|
||||
return '', ''
|
||||
|
||||
match = re.search('.*:http-equiv=refresh: \d+;URL=(.*).html.*',
|
||||
match = re.search('.*:http-equiv=refresh: \d+;URL=(.*).html(.*)',
|
||||
content)
|
||||
# Is it a redirect?
|
||||
return check_name, match
|
||||
@@ -440,8 +442,10 @@ def update_checks_list(clang_tidy_path):
|
||||
def format_link(doc_file):
|
||||
check_name, match = process_doc(doc_file)
|
||||
if not match and check_name:
|
||||
return ' `%(check)s <%(check)s.html>`_,%(autofix)s\n' % {
|
||||
'check': check_name,
|
||||
return ' `%(check_name)s <%(module)s/%(check)s.html>`_,%(autofix)s\n' % {
|
||||
'check_name': check_name,
|
||||
'module': doc_file[0],
|
||||
'check': doc_file[1].replace('.rst', ''),
|
||||
'autofix': has_auto_fix(check_name)
|
||||
}
|
||||
else:
|
||||
@@ -450,16 +454,27 @@ def update_checks_list(clang_tidy_path):
|
||||
def format_link_alias(doc_file):
|
||||
check_name, match = process_doc(doc_file)
|
||||
if match and check_name:
|
||||
module = doc_file[0]
|
||||
check_file = doc_file[1].replace('.rst', '')
|
||||
if match.group(1) == 'https://clang.llvm.org/docs/analyzer/checkers':
|
||||
title_redirect = 'Clang Static Analyzer'
|
||||
title = 'Clang Static Analyzer ' + check_file
|
||||
# Preserve the anchor in checkers.html from group 2.
|
||||
target = match.group(1) + '.html' + match.group(2)
|
||||
autofix = ''
|
||||
else:
|
||||
title_redirect = match.group(1)
|
||||
redirect_parts = re.search('^\.\./([^/]*)/([^/]*)$', match.group(1))
|
||||
title = redirect_parts[1] + '-' + redirect_parts[2]
|
||||
target = redirect_parts[1] + '/' + redirect_parts[2] + '.html'
|
||||
autofix = has_auto_fix(title)
|
||||
|
||||
# The checker is just a redirect.
|
||||
return ' `%(check)s <%(check)s.html>`_, `%(title)s <%(target)s.html>`_,%(autofix)s\n' % {
|
||||
'check': check_name,
|
||||
'target': match.group(1),
|
||||
'title': title_redirect,
|
||||
'autofix': has_auto_fix(match.group(1))
|
||||
return ' `%(check_name)s <%(module)s/%(check_file)s.html>`_, `%(title)s <%(target)s>`_,%(autofix)s\n' % {
|
||||
'check_name': check_name,
|
||||
'module': module,
|
||||
'check_file': check_file,
|
||||
'target': target,
|
||||
'title': title,
|
||||
'autofix': autofix
|
||||
}
|
||||
return ''
|
||||
|
||||
@@ -486,7 +501,7 @@ def update_checks_list(clang_tidy_path):
|
||||
def write_docs(module_path, module, check_name):
|
||||
check_name_dashes = module + '-' + check_name
|
||||
filename = os.path.normpath(os.path.join(
|
||||
module_path, '../../docs/clang-tidy/checks/', check_name_dashes + '.rst'))
|
||||
module_path, '../../docs/clang-tidy/checks/', module, check_name + '.rst'))
|
||||
print('Creating %s...' % filename)
|
||||
with io.open(filename, 'w', encoding='utf8', newline='\n') as f:
|
||||
f.write(""".. title:: clang-tidy - %(check_name_dashes)s
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace altera {
|
||||
/// degradation.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/altera-id-dependent-backward-branch.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/altera/id-dependent-backward-branch.html
|
||||
class IdDependentBackwardBranchCheck : public ClangTidyCheck {
|
||||
private:
|
||||
enum LoopType { UnknownLoop = -1, DoLoop = 0, WhileLoop = 1, ForLoop = 2 };
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace altera {
|
||||
/// `Verilog.cl`, or `VHDL.cl`.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/altera-kernel-name-restriction.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/altera/kernel-name-restriction.html
|
||||
class KernelNameRestrictionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
KernelNameRestrictionCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace altera {
|
||||
/// kernels, which may be inefficient or cause an error.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/opencl-single-work-item-barrier.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/opencl/single-work-item-barrier.html
|
||||
class SingleWorkItemBarrierCheck : public ClangTidyCheck {
|
||||
const unsigned AOCVersion;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace altera {
|
||||
/// packing and/or aligning of said structs as needed.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/altera-struct-pack-align.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/altera/struct-pack-align.html
|
||||
class StructPackAlignCheck : public ClangTidyCheck {
|
||||
public:
|
||||
StructPackAlignCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace altera {
|
||||
/// they cannot be fully unrolled, and should be partially unrolled.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/altera-unroll-loops.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/altera/unroll-loops.html
|
||||
class UnrollLoopsCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UnrollLoopsCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// Finds code that uses accept4() without using the SOCK_CLOEXEC flag.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-accept4.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-accept4.html
|
||||
class CloexecAccept4Check : public CloexecCheck {
|
||||
public:
|
||||
CloexecAccept4Check(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// accept() is better to be replaced by accept4().
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-accept.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-accept.html
|
||||
class CloexecAcceptCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecAcceptCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// creat() is better to be replaced by open().
|
||||
/// Find the usage of creat() and redirect user to use open().
|
||||
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-creat.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-creat.html
|
||||
class CloexecCreatCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecCreatCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace android {
|
||||
/// Find the usage of dup() and redirect user to use fcntl().
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-dup.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-dup.html
|
||||
class CloexecDupCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecDupCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// Finds code that uses epoll_create1() without using the EPOLL_CLOEXEC flag.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-epoll-create1.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-epoll-create1.html
|
||||
class CloexecEpollCreate1Check : public CloexecCheck {
|
||||
public:
|
||||
CloexecEpollCreate1Check(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// epoll_create() is better to be replaced by epoll_create1().
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-epoll-create.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-epoll-create.html
|
||||
class CloexecEpollCreateCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecEpollCreateCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace android {
|
||||
/// This check only works when corresponding argument is StringLiteral. No
|
||||
/// constant propagation.
|
||||
///
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-fopen.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-fopen.html
|
||||
class CloexecFopenCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecFopenCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// Finds code that uses inotify_init1() without using the IN_CLOEXEC flag.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-inotify-init1.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-inotify-init1.html
|
||||
class CloexecInotifyInit1Check : public CloexecCheck {
|
||||
public:
|
||||
CloexecInotifyInit1Check(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// inotify_init() is better to be replaced by inotify_init1().
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-inotify-init.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-inotify-init.html
|
||||
class CloexecInotifyInitCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecInotifyInitCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// Finds code that uses memfd_create() without using the MFD_CLOEXEC flag.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-memfd-create.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-memfd-create.html
|
||||
class CloexecMemfdCreateCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecMemfdCreateCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// Finds code that uses pipe2() without using the O_CLOEXEC flag.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-pipe2.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-pipe2.html
|
||||
class CloexecPipe2Check : public CloexecCheck {
|
||||
public:
|
||||
CloexecPipe2Check(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// Suggests to replace calls to pipe() with calls to pipe2().
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-pipe.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-pipe.html
|
||||
class CloexecPipeCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecPipeCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace android {
|
||||
/// Finds code that uses socket() without using the SOCK_CLOEXEC flag.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-socket.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-socket.html
|
||||
class CloexecSocketCheck : public CloexecCheck {
|
||||
public:
|
||||
CloexecSocketCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace boost {
|
||||
/// ``std::to_string`` and ``std::to_wstring`` calls.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/boost-use-to-string.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/boost/use-to-string.html
|
||||
class UseToStringCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UseToStringCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Finds ``pthread_kill`` function calls when thread is terminated by
|
||||
/// ``SIGTERM`` signal.
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-bad-signal-to-kill-thread.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/bad-signal-to-kill-thread.html
|
||||
class BadSignalToKillThreadCheck : public ClangTidyCheck {
|
||||
public:
|
||||
BadSignalToKillThreadCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace bugprone {
|
||||
/// the true and false expressions are Type I clones of each other.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-branch-clone.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/branch-clone.html
|
||||
class BranchCloneCheck : public ClangTidyCheck {
|
||||
public:
|
||||
BranchCloneCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// the base class.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/misc-copy-constructor-init.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/misc/copy-constructor-init.html
|
||||
class CopyConstructorInitCheck : public ClangTidyCheck {
|
||||
public:
|
||||
CopyConstructorInitCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// std::experimental::string_view.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-dangling-handle.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/dangling-handle.html
|
||||
class DanglingHandleCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DanglingHandleCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace bugprone {
|
||||
/// swapped (or badly ordered) arguments.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-easily-swappable-parameters.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/easily-swappable-parameters.html
|
||||
class EasilySwappableParametersCheck : public ClangTidyCheck {
|
||||
public:
|
||||
EasilySwappableParametersCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace bugprone {
|
||||
/// given as option to the checker.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-exception-escape.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/exception-escape.html
|
||||
class ExceptionEscapeCheck : public ClangTidyCheck {
|
||||
public:
|
||||
ExceptionEscapeCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace bugprone {
|
||||
/// \endcode
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-fold-init-type.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/fold-init-type.html
|
||||
class FoldInitTypeCheck : public ClangTidyCheck {
|
||||
public:
|
||||
FoldInitTypeCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace bugprone {
|
||||
/// point.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-forward-declaration-namespace.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/forward-declaration-namespace.html
|
||||
class ForwardDeclarationNamespaceCheck : public ClangTidyCheck {
|
||||
public:
|
||||
ForwardDeclarationNamespaceCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace bugprone {
|
||||
/// C++ Design, item 26.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-forwarding-reference-overload.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/forwarding-reference-overload.html
|
||||
class ForwardingReferenceOverloadCheck : public ClangTidyCheck {
|
||||
public:
|
||||
ForwardingReferenceOverloadCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// Diagnoses instances of an implicit widening of multiplication result.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/implicit-widening-of-multiplication-result.html
|
||||
class ImplicitWideningOfMultiplicationResultCheck : public ClangTidyCheck {
|
||||
const ast_matchers::MatchFinder::MatchResult *Result;
|
||||
bool ShouldUseCXXStaticCast;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// not changed at all).
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-infinite-loop.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/infinite-loop.html
|
||||
class InfiniteLoopCheck : public ClangTidyCheck {
|
||||
public:
|
||||
InfiniteLoopCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// cause unintended loss of precision.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-integer-division.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/integer-division.html
|
||||
class IntegerDivisionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
IntegerDivisionCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace bugprone {
|
||||
/// (i.e., `operator()`).
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-lambda-function-name.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/lambda-function-name.html
|
||||
class LambdaFunctionNameCheck : public ClangTidyCheck {
|
||||
public:
|
||||
struct SourceRangeLessThan {
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace bugprone {
|
||||
/// argument to a memory allocation function.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-operator-in-strlen-in-alloc.html
|
||||
class MisplacedOperatorInStrlenInAllocCheck : public ClangTidyCheck {
|
||||
public:
|
||||
MisplacedOperatorInStrlenInAllocCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// memory allocation function instead of its argument.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-misplaced-operator-in-alloc.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-operator-in-alloc.html
|
||||
class MisplacedPointerArithmeticInAllocCheck : public ClangTidyCheck {
|
||||
public:
|
||||
MisplacedPointerArithmeticInAllocCheck(StringRef Name,
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace bugprone {
|
||||
// be the most common case. Enabled by default.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-misplaced-widening-cast.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-widening-cast.html
|
||||
class MisplacedWideningCastCheck : public ClangTidyCheck {
|
||||
public:
|
||||
MisplacedWideningCastCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace bugprone {
|
||||
/// The check suggests replacing the std::move with a std::forward.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-move-forwarding-reference.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/move-forwarding-reference.html
|
||||
class MoveForwardingReferenceCheck : public ClangTidyCheck {
|
||||
public:
|
||||
MoveForwardingReferenceCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace bugprone {
|
||||
/// other ones will be executed unconditionally.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-multiple-statement-macro.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/multiple-statement-macro.html
|
||||
class MultipleStatementMacroCheck : public ClangTidyCheck {
|
||||
public:
|
||||
MultipleStatementMacroCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace bugprone {
|
||||
/// attribute, then we warn the user of their error.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-no-escape.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/no-escape.html
|
||||
class NoEscapeCheck : public ClangTidyCheck {
|
||||
public:
|
||||
NoEscapeCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace bugprone {
|
||||
/// when the string is read.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-not-null-terminated-result.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/not-null-terminated-result.html
|
||||
class NotNullTerminatedResultCheck : public ClangTidyCheck {
|
||||
public:
|
||||
NotNullTerminatedResultCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Finds calls to grand..-parent virtual methods instead of parent's.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-parent-virtual-call.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/parent-virtual-call.html
|
||||
class ParentVirtualCallCheck : public ClangTidyCheck {
|
||||
public:
|
||||
ParentVirtualCallCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// in the outer `if` statement and were not changed.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-redundant-branch-condition.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/redundant-branch-condition.html
|
||||
class RedundantBranchConditionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
RedundantBranchConditionCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace bugprone {
|
||||
/// double underscore occurring anywhere.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-reserved-identifier.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/reserved-identifier.html
|
||||
class ReservedIdentifierCheck final : public RenamerClangTidyCheck {
|
||||
const bool Invert;
|
||||
const std::vector<StringRef> AllowedIdentifiers;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace bugprone {
|
||||
/// Checker for signal handler functions.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-signal-handler-check.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/signal-handler-check.html
|
||||
class SignalHandlerCheck : public ClangTidyCheck {
|
||||
public:
|
||||
enum class AsyncSafeFunctionSetKind { Minimal, POSIX };
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace bugprone {
|
||||
/// implicit conversion happens.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-signed-char-misuse.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/signed-char-misuse.html
|
||||
class SignedCharMisuseCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SignedCharMisuseCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// user wanted to use `.size()` instead.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-sizeof-container.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/sizeof-container.html
|
||||
class SizeofContainerCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SizeofContainerCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Find suspicious usages of sizeof expression.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-sizeof-expression.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/sizeof-expression.html
|
||||
class SizeofExpressionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SizeofExpressionCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace bugprone {
|
||||
/// condition parameter.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-spuriously-wake-up-functions.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/spuriously-wake-up-functions.html
|
||||
class SpuriouslyWakeUpFunctionsCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SpuriouslyWakeUpFunctionsCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Finds suspicious string constructor and check their parameters.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-constructor.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/string-constructor.html
|
||||
class StringConstructorCheck : public ClangTidyCheck {
|
||||
public:
|
||||
StringConstructorCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Finds instances where an integer is assigned to a string.
|
||||
///
|
||||
/// For more details see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/misc-string-assignment.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/misc/string-assignment.html
|
||||
class StringIntegerAssignmentCheck : public ClangTidyCheck {
|
||||
public:
|
||||
StringIntegerAssignmentCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Find suspicious string literals with embedded NUL characters.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-string-literal-with-embedded-nul.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.html
|
||||
class StringLiteralWithEmbeddedNulCheck : public ClangTidyCheck {
|
||||
public:
|
||||
StringLiteralWithEmbeddedNulCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace bugprone {
|
||||
/// to `nullptr`.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-stringview-nullptr.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/stringview-nullptr.html
|
||||
class StringviewNullptrCheck : public utils::TransformerClangTidyCheck {
|
||||
public:
|
||||
StringviewNullptrCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// The checker detects various cases when an enum is probably misused (as a
|
||||
/// bitmask).
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-enum-usage.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-enum-usage.html
|
||||
class SuspiciousEnumUsageCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SuspiciousEnumUsageCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace bugprone {
|
||||
/// filename extensions of implementation files. "c;cc;cpp;cxx" by default.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-include.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-include.html
|
||||
class SuspiciousIncludeCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SuspiciousIncludeCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// arguments.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-memory-comparison.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-memory-comparison.html
|
||||
class SuspiciousMemoryComparisonCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SuspiciousMemoryComparisonCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Finds memset calls with potential mistakes in their arguments.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-memset-usage.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-memset-usage.html
|
||||
class SuspiciousMemsetUsageCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SuspiciousMemsetUsageCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// accidentally.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-missing-comma.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-missing-comma.html
|
||||
class SuspiciousMissingCommaCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SuspiciousMissingCommaCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// unintendedly.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-semicolon.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-semicolon.html
|
||||
class SuspiciousSemicolonCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SuspiciousSemicolonCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Find suspicious calls to string compare functions.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-string-compare.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-string-compare.html
|
||||
class SuspiciousStringCompareCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SuspiciousStringCompareCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// a condition which always evaluates to false).
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-terminating-continue.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/terminating-continue.html
|
||||
class TerminatingContinueCheck : public ClangTidyCheck {
|
||||
public:
|
||||
TerminatingContinueCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// class that has 'EXCEPTION', 'Exception' or 'exception' in its name.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-throw-keyword-missing.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/throw-keyword-missing.html
|
||||
class ThrowKeywordMissingCheck : public ClangTidyCheck {
|
||||
public:
|
||||
ThrowKeywordMissingCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace bugprone {
|
||||
/// \endcode
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-too-small-loop-variable.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/too-small-loop-variable.html
|
||||
class TooSmallLoopVariableCheck : public ClangTidyCheck {
|
||||
public:
|
||||
TooSmallLoopVariableCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace bugprone {
|
||||
/// or `base::Optional<T>` object without assuring that it contains a value.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unchecked-optional-access.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/unchecked-optional-access.html
|
||||
class UncheckedOptionalAccessCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UncheckedOptionalAccessCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace bugprone {
|
||||
/// behavior.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-undefined-memory-manipulation.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/undefined-memory-manipulation.html
|
||||
class UndefinedMemoryManipulationCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UndefinedMemoryManipulationCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// failure.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unhandled-exception-at-new.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/unhandled-exception-at-new.html
|
||||
class UnhandledExceptionAtNewCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UnhandledExceptionAtNewCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace bugprone {
|
||||
/// using the copy-and-swap or the copy-and-move method.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unhandled-self-assignment.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/unhandled-self-assignment.html
|
||||
class UnhandledSelfAssignmentCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UnhandledSelfAssignmentCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace bugprone {
|
||||
/// Finds temporaries that look like RAII objects.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unused-raii.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/unused-raii.html
|
||||
class UnusedRaiiCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UnusedRaiiCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// Detects function calls where the return value is unused.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unused-return-value.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/unused-return-value.html
|
||||
class UnusedReturnValueCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UnusedReturnValueCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace bugprone {
|
||||
/// intervening reinitialization.
|
||||
///
|
||||
/// For details, see the user-facing documentation:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-use-after-move.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/use-after-move.html
|
||||
class UseAfterMoveCheck : public ClangTidyCheck {
|
||||
public:
|
||||
UseAfterMoveCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace bugprone {
|
||||
/// very similar name and an identical signature defined in a base class.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-virtual-near-miss.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/virtual-near-miss.html
|
||||
class VirtualNearMissCheck : public ClangTidyCheck {
|
||||
public:
|
||||
VirtualNearMissCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace cert {
|
||||
/// actually launched.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-env33-c.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/env33-c.html
|
||||
class CommandProcessorCheck : public ClangTidyCheck {
|
||||
public:
|
||||
CommandProcessorCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace cert {
|
||||
/// the default operator new.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-mem57-cpp.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/mem57-cpp.html
|
||||
class DefaultOperatorNewAlignmentCheck : public ClangTidyCheck {
|
||||
public:
|
||||
DefaultOperatorNewAlignmentCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace cert {
|
||||
/// https://www.securecoding.cert.org/confluence/display/c/FLP30-C.+Do+not+use+floating-point+variables+as+loop+counters
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-flp30-c.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/flp30-c.html
|
||||
class FloatLoopCounter : public ClangTidyCheck {
|
||||
public:
|
||||
FloatLoopCounter(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace cert {
|
||||
/// This check warns for the usage of std::rand() function.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-msc50-cpp.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/msc50-cpp.html
|
||||
class LimitedRandomnessCheck : public ClangTidyCheck {
|
||||
public:
|
||||
LimitedRandomnessCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace cert {
|
||||
/// in copy constructors and copy assignment operators.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-oop58-cpp.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/oop58-cpp.html
|
||||
class MutatingCopyCheck : public ClangTidyCheck {
|
||||
public:
|
||||
MutatingCopyCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace cert {
|
||||
/// 'memcmp' and similar derivatives on non-trivial types.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-oop57-cpp.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/oop57-cpp.html
|
||||
class NonTrivialTypesLibcMemoryCallsCheck : public ClangTidyCheck {
|
||||
public:
|
||||
NonTrivialTypesLibcMemoryCallsCheck(StringRef Name,
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace cert {
|
||||
/// constant expression is a security vulnerability.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-properly-seeded-random-generator.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/properly-seeded-random-generator.html
|
||||
class ProperlySeededRandomGeneratorCheck : public ClangTidyCheck {
|
||||
public:
|
||||
ProperlySeededRandomGeneratorCheck(StringRef Name, ClangTidyContext *Context);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace cert {
|
||||
/// Guards against use of setjmp/longjmp in C++ code
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-err52-cpp.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/err52-cpp.html
|
||||
class SetLongJmpCheck : public ClangTidyCheck {
|
||||
public:
|
||||
SetLongJmpCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace cert {
|
||||
/// throw.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-err58-cpp.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/err58-cpp.html
|
||||
class StaticObjectExceptionCheck : public ClangTidyCheck {
|
||||
public:
|
||||
StaticObjectExceptionCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace cert {
|
||||
/// reasonable error handling for conversion errors.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-err34-c.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/err34-c.html
|
||||
class StrToNumCheck : public ClangTidyCheck {
|
||||
public:
|
||||
StrToNumCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace cert {
|
||||
/// Checks whether a thrown object is nothrow copy constructible.
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-err60-cpp.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/err60-cpp.html
|
||||
class ThrownExceptionTypeCheck : public ClangTidyCheck {
|
||||
public:
|
||||
ThrownExceptionTypeCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace cert {
|
||||
/// Guards against any C-style variadic function definitions (not declarations).
|
||||
///
|
||||
/// For the user-facing documentation see:
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert-dcl50-cpp.html
|
||||
/// http://clang.llvm.org/extra/clang-tidy/checks/cert/dcl50-cpp.html
|
||||
class VariadicFunctionDefCheck : public ClangTidyCheck {
|
||||
public:
|
||||
VariadicFunctionDefCheck(StringRef Name, ClangTidyContext *Context)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user