summaryrefslogtreecommitdiff
path: root/buildscripts/linter
diff options
context:
space:
mode:
authorJuan Gu <juan.gu@mongodb.com>2023-03-27 23:21:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-03-28 01:06:44 +0000
commit28c4056019e8ceae6c97e31c26f571a8b6ff16f9 (patch)
treedb4a49e4d0392a63ef7c30cbf7fc53f3df32c4c5 /buildscripts/linter
parenta66abc65d64797c8715d7329e4542e0880574300 (diff)
downloadmongo-28c4056019e8ceae6c97e31c26f571a8b6ff16f9.tar.gz
SERVER-71744 Move atomic, mutex and nonmongo assert to clang-tidy
Diffstat (limited to 'buildscripts/linter')
-rw-r--r--buildscripts/linter/simplecpplint.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/buildscripts/linter/simplecpplint.py b/buildscripts/linter/simplecpplint.py
index 615f6a2bd82..919b4143e0e 100644
--- a/buildscripts/linter/simplecpplint.py
+++ b/buildscripts/linter/simplecpplint.py
@@ -54,8 +54,6 @@ _RE_LINT = re.compile("//.*NOLINT")
_RE_COMMENT_STRIP = re.compile("//.*")
_RE_PATTERN_MONGO_POLYFILL = _make_polyfill_regex()
-_RE_MUTEX = re.compile('(^|[ ({,])stdx?::mutex[ ({]')
-_RE_ASSERT = re.compile(r'\bassert\s*\(')
_RE_UNSTRUCTURED_LOG = re.compile(r'\blogd\s*\(')
_RE_COLLECTION_SHARDING_RUNTIME = re.compile(r'\bCollectionShardingRuntime\b')
_RE_RAND = re.compile(r'\b(srand\(|rand\(\))')
@@ -153,9 +151,6 @@ class Linter:
continue
self._check_for_mongo_polyfill(linenum)
- self._check_for_mongo_atomic(linenum)
- self._check_for_mongo_mutex(linenum)
- self._check_for_nonmongo_assert(linenum)
self._check_for_mongo_unstructured_log(linenum)
self._check_for_mongo_config_header(linenum)
self._check_for_collection_sharding_runtime(linenum)
@@ -240,29 +235,6 @@ class Linter:
'Illegal use of banned name from std::/boost:: for "%s", use mongo::stdx:: variant instead'
% (match.group(0)))
- def _check_for_mongo_atomic(self, linenum):
- line = self.clean_lines[linenum]
- if 'std::atomic' in line:
- self._error(
- linenum, 'mongodb/stdatomic',
- 'Illegal use of prohibited std::atomic<T>, use AtomicWord<T> or other types '
- 'from "mongo/platform/atomic_word.h"')
-
- def _check_for_mongo_mutex(self, linenum):
- line = self.clean_lines[linenum]
- if _RE_MUTEX.search(line):
- self._error(
- linenum, 'mongodb/stdxmutex', 'Illegal use of prohibited stdx::mutex, '
- 'use mongo::Mutex from mongo/platform/mutex.h instead.')
-
- def _check_for_nonmongo_assert(self, linenum):
- line = self.clean_lines[linenum]
- if _RE_ASSERT.search(line):
- self._error(
- linenum, 'mongodb/assert',
- 'Illegal use of the bare assert function, use a function from assert_utils.h instead.'
- )
-
def _check_for_mongo_unstructured_log(self, linenum):
line = self.clean_lines[linenum]
if _RE_UNSTRUCTURED_LOG.search(line) or 'doUnstructuredLogImpl' in line: