Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a length check of non-comment lines in C/C++ to the cookbook #89

Merged
merged 7 commits into from
Aug 9, 2024
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 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,13 @@ 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
codingjoe marked this conversation as resolved.
Show resolved Hide resolved
- 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)
```