summaryrefslogtreecommitdiff
path: root/buildscripts/linter
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2020-10-09 20:50:38 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-13 19:30:17 +0000
commitff37b70553dbfd0b2aaeabb8a29c4d492507a9d3 (patch)
tree728b9266de70d79901eed31b0e39de0abc78cf24 /buildscripts/linter
parentbbe604a5b3f94f78a30a76941ea89c0ca5db14d2 (diff)
downloadmongo-ff37b70553dbfd0b2aaeabb8a29c4d492507a9d3.tar.gz
SERVER-50917 util/ctype.h to replace <cctype> & <ctype.h> funcs
Diffstat (limited to 'buildscripts/linter')
-rw-r--r--buildscripts/linter/simplecpplint.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/buildscripts/linter/simplecpplint.py b/buildscripts/linter/simplecpplint.py
index a1cd50f94d3..e0b3e4a04e2 100644
--- a/buildscripts/linter/simplecpplint.py
+++ b/buildscripts/linter/simplecpplint.py
@@ -126,6 +126,7 @@ class Linter:
self._check_for_nonmongo_assert(linenum)
self._check_for_mongo_unstructured_log(linenum)
self._check_for_mongo_config_header(linenum)
+ self._check_for_ctype(linenum)
# Relax the rule of commenting generic FCV references for files directly related to FCV
# implementations.
@@ -216,6 +217,12 @@ class Linter:
linenum, 'mongodb/unstructuredlog', 'Illegal use of unstructured logging, '
'this is only for local development use and should not be committed.')
+ def _check_for_ctype(self, linenum):
+ line = self.clean_lines[linenum]
+ if 'include <cctype>' in line or 'include <ctype.h>' in line:
+ self._error(linenum, 'mongodb/ctype',
+ 'Use of prohibited <ctype.h> or <cctype> header, use "mongo/util/ctype.h"')
+
def _check_for_server_side_public_license(self, copyright_offset):
license_header = '''\
* This program is free software: you can redistribute it and/or modify