Skip to content

Commit

Permalink
Add a length check of non-comment lines in C/C++ to the cookbook (#89)
Browse files Browse the repository at this point in the history

Co-authored-by: Johannes Maron <johannes@maron.family>
  • Loading branch information
yangcht and codingjoe authored Aug 9, 2024
1 parent 4eef740 commit 8da6c45
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions COOKBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A collection of recipes for reLint. Please feel free to contribute!
- [Python](#python)
- [Django](#django)
- [HTML](#html)
- [C/C++](#cc)

# Python

Expand Down Expand Up @@ -104,3 +105,14 @@ A collection of recipes for reLint. Please feel free to contribute!
You may use a CSS class instead.
filePattern: .*\.(html|vue|jsx|tsx)
```
# C/C++
```yaml
# This rule requires you to install the extra `regex` dependency.
- name: no line longer than 120 characters in a line (excluding comments) # by @yangcht
pattern: '(?<!^[ \u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]*//.*)(?<!/\*(?:(?!\*/)[\s\S\r])*?)\b(.{120,})\b'
hint: |
Please do not use more than 120 characters in codes except for comments.
filePattern: .*\.(C|cc|cxx|cpp|c++|cppm)
```

0 comments on commit 8da6c45

Please sign in to comment.