github.com/yoheimuta/protolint@v0.49.8-0.20240515023657-4ecaebb7575d/_example/config/.protolint.yaml (about) 1 --- 2 # Lint directives. 3 lint: 4 # Linter files to ignore. 5 ignores: 6 - id: MESSAGE_NAMES_UPPER_CAMEL_CASE 7 files: 8 # NOTE: UNIX paths will be properly accepted by both UNIX and Windows. 9 - _example/proto/simple.proto 10 - id: ENUM_NAMES_UPPER_CAMEL_CASE 11 files: 12 - path/to/foo.proto 13 14 # Linter files to walk. 15 files: 16 # The specific files to exclude. 17 exclude: 18 # NOTE: UNIX paths will be properly accepted by both UNIX and Windows. 19 - path/to/file 20 21 # Linter directories to walk. 22 directories: 23 # The specific directories to exclude. 24 exclude: 25 # NOTE: UNIX paths will be properly accepted by both UNIX and Windows. 26 - path/to/dir 27 28 # Linter rules. 29 # Run `protolint list` to see all available rules. 30 rules: 31 # Determines whether or not to include the default set of linters. 32 no_default: true 33 34 # Set the default to all linters. This option works the other way around as no_default does. 35 # If you want to enable this option, delete the comment out below and no_default. 36 # all_default: true 37 38 # The specific linters to add. 39 add: 40 - FIELD_NAMES_LOWER_SNAKE_CASE 41 - MESSAGE_NAMES_UPPER_CAMEL_CASE 42 - MAX_LINE_LENGTH 43 - INDENT 44 - SERVICE_NAMES_END_WITH 45 - FIELD_NAMES_EXCLUDE_PREPOSITIONS 46 - MESSAGE_NAMES_EXCLUDE_PREPOSITIONS 47 - FILE_NAMES_LOWER_SNAKE_CASE 48 - IMPORTS_SORTED 49 - PACKAGE_NAME_LOWER_CASE 50 - ORDER 51 - MESSAGES_HAVE_COMMENT 52 - SERVICES_HAVE_COMMENT 53 - RPCS_HAVE_COMMENT 54 - FIELDS_HAVE_COMMENT 55 - PROTO3_FIELDS_AVOID_REQUIRED 56 - PROTO3_GROUPS_AVOID 57 - REPEATED_FIELD_NAMES_PLURALIZED 58 - ENUMS_HAVE_COMMENT 59 - ENUM_FIELDS_HAVE_COMMENT 60 - SYNTAX_CONSISTENT 61 - RPC_NAMES_CASE 62 - FILE_HAS_COMMENT 63 - QUOTE_CONSISTENT 64 65 # The specific linters to remove. 66 remove: 67 - RPC_NAMES_UPPER_CAMEL_CASE 68 69 # Linter rules option. 70 rules_option: 71 # MAX_LINE_LENGTH rule option. 72 max_line_length: 73 # Enforces a maximum line length 74 max_chars: 80 75 # Specifies the character count for tab characters 76 tab_chars: 2 77 78 # INDENT rule option. 79 indent: 80 # Available styles are 4(4-spaces), 2(2-spaces) or tab. 81 style: 4 82 # Specifies if it should stop considering and inserting new lines at the appropriate positions 83 # when the inner elements are on the same line. Default is false. 84 not_insert_newline: true 85 86 # FILE_NAMES_LOWER_SNAKE_CASE rule option. 87 file_names_lower_snake_case: 88 excludes: 89 - ../proto/invalidFileName.proto 90 91 # QUOTE_CONSISTENT rule option. 92 quote_consistent: 93 # Available quote are "double" or "single". 94 quote: double 95 96 # ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH rule option. 97 enum_field_names_zero_value_end_with: 98 suffix: INVALID 99 100 # SERVICE_NAMES_END_WITH rule option. 101 service_names_end_with: 102 text: Service 103 104 # FIELD_NAMES_EXCLUDE_PREPOSITIONS rule option. 105 field_names_exclude_prepositions: 106 # The specific prepositions to determine if the field name includes. 107 prepositions: 108 - for 109 - at 110 - of 111 # The specific keywords including prepositions to ignore. E.g. end_of_support is a term you would like to use, and skip checking. 112 excludes: 113 - end_of_support 114 115 # REPEATED_FIELD_NAMES_PLURALIZED rule option. 116 ## The spec for each rules follows the implementation of https://github.com/gertd/go-pluralize. 117 ## Plus, you can refer to this rule's test code. 118 repeated_field_names_pluralized: 119 uncountable_rules: 120 - paper 121 irregular_rules: 122 Irregular: Regular 123 124 # MESSAGE_NAMES_EXCLUDE_PREPOSITIONS rule option. 125 message_names_exclude_prepositions: 126 # The specific prepositions to determine if the message name includes. 127 prepositions: 128 - With 129 - For 130 - Of 131 # The specific keywords including prepositions to ignore. E.g. EndOfSupport is a term you would like to use, and skip checking. 132 excludes: 133 - EndOfSupport 134 - 135 # RPC_NAMES_CASE rule option. 136 rpc_names_case: 137 # The specific convention the name should conforms to. 138 ## Available conventions are "lower_camel_case", "upper_snake_case", or "lower_snake_case". 139 convention: upper_snake_case 140 141 # MESSAGES_HAVE_COMMENT rule option. 142 messages_have_comment: 143 # Comments need to begin with the name of the thing being described. default is false. 144 should_follow_golang_style: true 145 146 # SERVICES_HAVE_COMMENT rule option. 147 services_have_comment: 148 # Comments need to begin with the name of the thing being described. default is false. 149 should_follow_golang_style: true 150 151 # RPCS_HAVE_COMMENT rule option. 152 rpcs_have_comment: 153 # Comments need to begin with the name of the thing being described. default is false. 154 should_follow_golang_style: true 155 156 # FIELDS_HAVE_COMMENT rule option. 157 fields_have_comment: 158 # Comments need to begin with the name of the thing being described. default is false. 159 should_follow_golang_style: true 160 161 # ENUMS_HAVE_COMMENT rule option. 162 enums_have_comment: 163 # Comments need to begin with the name of the thing being described. default is false. 164 should_follow_golang_style: true 165 166 # ENUM_FIELDS_HAVE_COMMENT rule option. 167 enum_fields_have_comment: 168 # Comments need to begin with the name of the thing being described. default is false. 169 should_follow_golang_style: true 170 171 # SYNTAX_CONSISTENT rule option. 172 syntax_consistent: 173 # Default is proto3. 174 version: proto2