Skip to content

Commit fa6e6a3

Browse files
author
MarcoFalke
committed
doc: Remove confusing assert linter
1 parent f5c5dda commit fa6e6a3

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

doc/developer-notes.md

-6
Original file line numberDiff line numberDiff line change
@@ -739,12 +739,6 @@ Common misconceptions are clarified in those sections:
739739
- Passing (non-)fundamental types in the [C++ Core
740740
Guideline](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-conventional).
741741

742-
- Assertions should not have side-effects.
743-
744-
- *Rationale*: Even though the source code is set to refuse to compile
745-
with assertions disabled, having side-effects in assertions is unexpected and
746-
makes the code harder to understand.
747-
748742
- If you use the `.h`, you must link the `.cpp`.
749743

750744
- *Rationale*: Include files define the interface for the code in implementation files. Including one but

test/lint/lint-assertions.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,10 @@ def git_grep(params: [], error_msg: ""):
2323

2424

2525
def main():
26-
# PRE31-C (SEI CERT C Coding Standard):
27-
# "Assertions should not contain assignments, increment, or decrement operators."
28-
exit_code = git_grep([
29-
"-E",
30-
r"[^_]assert\(.*(\+\+|\-\-|[^=!<>]=[^=!<>]).*\);",
31-
"--",
32-
"*.cpp",
33-
"*.h",
34-
], "Assertions should not have side effects:")
35-
3626
# Aborting the whole process is undesirable for RPC code. So nonfatal
3727
# checks should be used over assert. See: src/util/check.h
3828
# src/rpc/server.cpp is excluded from this check since it's mostly meta-code.
39-
exit_code |= git_grep([
29+
exit_code = git_grep([
4030
"-nE",
4131
r"\<(A|a)ss(ume|ert) *\(.*\);",
4232
"--",

0 commit comments

Comments
 (0)