Created
May 4, 2022 12:27
-
-
Save invidian/bf8db8741a28a60aa95f9953adf9641b to your computer and use it in GitHub Desktop.
Semgrep file whitespace rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rules: | |
- id: files-must-not-have-trailing-whitespace | |
patterns: | |
- pattern-regex: '[[:blank:]]$' | |
message: Files must not have any trailing whitespace. | |
languages: [generic] | |
severity: ERROR | |
- id: files-must-not-have-trailing-newlines | |
patterns: | |
- pattern-regex: '\n\n\Z' | |
message: Files must not have any trailing newlines. | |
languages: [generic] | |
severity: ERROR | |
- id: all-lines-must-end-with-newline | |
patterns: | |
- pattern-regex: '\S\z' | |
message: All lines must end with newline. | |
languages: [generic] | |
severity: ERROR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment