checkCommentLineForCheckIgnore checks that the comment line starts with the configured comment ignore prefix, a space and the ruleID of the check. All of the following comments are valid, ignoring SERVICE_PASCAL_CASE and this rule only: // buf:lint:ignore SERVICE_PASCAL_CASE, SERVICE_SUFFIX (only
( commentLine string, commentIgnorePrefix string, ruleID string, )
| 850 | // |
| 851 | // // buf:lint:ignoreSERVICE_PASCAL_CASE |
| 852 | func checkCommentLineForCheckIgnore( |
| 853 | commentLine string, |
| 854 | commentIgnorePrefix string, |
| 855 | ruleID string, |
| 856 | ) bool { |
| 857 | fullIgnorePrefix := commentIgnorePrefix + " " + ruleID |
| 858 | return strings.HasPrefix(commentLine, fullIgnorePrefix) |
| 859 | } |
| 860 | |
| 861 | type lintOptions struct { |
| 862 | pluginConfigs []bufconfig.PluginConfig |
no outgoing calls
no test coverage detected
searching dependent graphs…