Skip to content

Commit 22c07c4

Browse files
authored
Merge pull request #2645 from rust-lang/tshepang/sembr
sembr sanitizers.md again
2 parents f63939a + 600a5e3 commit 22c07c4

File tree

3 files changed

+38
-19
lines changed

3 files changed

+38
-19
lines changed

ci/sembr/Cargo.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/sembr/src/main.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ fn lengthen_lines(content: &str, limit: usize) -> String {
177177
let Some(next_line) = content.get(n + 1) else {
178178
continue;
179179
};
180-
if ignore(next_line, in_code_block) || REGEX_IGNORE_END.is_match(line) {
180+
if ignore(next_line, in_code_block)
181+
|| REGEX_LIST_ENTRY.is_match(next_line)
182+
|| REGEX_IGNORE_END.is_match(line)
183+
{
181184
continue;
182185
}
183186
if line.len() + next_line.len() < limit {
@@ -244,12 +247,28 @@ short sentences
244247
<div class='warning'>
245248
a bit of text inside
246249
</div>
250+
preserve next line
251+
1. one
252+
253+
preserve next line
254+
- two
255+
256+
preserve next line
257+
* three
247258
";
248259
let expected = "\
249260
do not split short sentences
250261
<div class='warning'>
251262
a bit of text inside
252263
</div>
264+
preserve next line
265+
1. one
266+
267+
preserve next line
268+
- two
269+
270+
preserve next line
271+
* three
253272
";
254273
assert_eq!(expected, lengthen_lines(original, 50));
255274
}

src/sanitizers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
The rustc compiler contains support for following sanitizers:
44

5-
* [AddressSanitizer][clang-asan] a faster memory error detector. Can
6-
detect out-of-bounds access to heap, stack, and globals, use after free, use
5+
* [AddressSanitizer][clang-asan] a faster memory error detector.
6+
Can detect out-of-bounds access to heap, stack, and globals, use after free, use
77
after return, double free, invalid free, memory leaks.
88
* [ControlFlowIntegrity][clang-cfi] LLVM Control Flow Integrity (CFI) provides
99
forward-edge control flow protection.

0 commit comments

Comments
 (0)